From f331e1389c93765fafd3b9553762612b0c351304 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 20 Dec 2002 20:10:48 +0000 Subject: (touch): Change the wording of a diagnostic so that it makes sense both when the file exists and when it doesn't. --- src/touch.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/touch.c') diff --git a/src/touch.c b/src/touch.c index 645357082..faec81911 100644 --- a/src/touch.c +++ b/src/touch.c @@ -214,7 +214,13 @@ touch (const char *file) if (status) { if (open_errno) - error (0, open_errno, _("creating %s"), quote (file)); + { + /* The wording of this diagnostic should cover at least two cases: + - the file does not exist, but the parent directory is unwritable + - the file exists, but it isn't writable + I think it's not worth trying to distinguish them. */ + error (0, open_errno, _("cannot touch %s"), quote (file)); + } else { if (no_create && errno == ENOENT) -- cgit v1.2.3-54-g00ecf