From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fngNv-0005h4-DT for barebox@lists.infradead.org; Thu, 09 Aug 2018 08:33:34 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 9 Aug 2018 10:33:13 +0200 Message-Id: <20180809083313.13034-3-u.kleine-koenig@pengutronix.de> In-Reply-To: <20180809083313.13034-1-u.kleine-koenig@pengutronix.de> References: <20180809083313.13034-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 3/3] commands: teach commands that write to files to also create them To: barebox@lists.infradead.org VGhpcyBhbGxvd3MgdG8gdXNlIHRoZSBhZGFwdGVkIGNvbW1hbmRzIG9uIG5vbi1leGlzdGluZyBm aWxlcyB3aGljaApmYWlsZWQgYmVmb3JlIHdpdGgKCglvcGVuOiBObyBzdWNoIGZpbGUgb3IgZGly ZWN0b3J5CgpTaWduZWQtb2ZmLWJ5OiBVd2UgS2xlaW5lLUvDtm5pZyA8dS5rbGVpbmUta29lbmln QHBlbmd1dHJvbml4LmRlPgotLS0KIGNvbW1hbmRzL21lbXNldC5jIHwgMiArLQogY29tbWFuZHMv bW0uYyAgICAgfCAyICstCiBjb21tYW5kcy9tdy5jICAgICB8IDIgKy0KIDMgZmlsZXMgY2hhbmdl ZCwgMyBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2NvbW1hbmRz L21lbXNldC5jIGIvY29tbWFuZHMvbWVtc2V0LmMKaW5kZXggZjg3MWUwN2M5NTIzLi5mOTliZjg2 Yz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