#794806 jhead: jhead refuses to rename read-only files

Package:
jhead
Source:
jhead
Description:
manipulate the non-image part of Exif compliant JPEG files
Submitter:
Toby Speight
Date:
2015-08-10 11:00:16 UTC
Severity:
normal
#794806#5
Date:
2015-08-06 19:08:09 UTC
From:
To:
I have a writable directory containing some JPEG files that are
non-writable for me.  I want to rename them by their timestamps (but
not to inadvertently change their content).  But "jhead -n" refuses,
saying "Skipping readonly file".

The -n option doesn't write the file at all, only the directory, and "mv" has
no objections to that.  But jhead doesn't check the directory's permissions
in the same way, so it's completely inconsistent.  I tried an experiment with
a read-only directory containing writable files, and it tried to rename them,
reporting the error: "Error: Couldn't rename ..."

Instead of skipping readonly files, it makes sense to continue as normal
until/unless a system call gives us a failure, then report it - like
every other Unix utility.  That's more reliable that doing access()
checks, or whatever it is that jhead does.

#794806#10
Date:
2015-08-09 13:46:51 UTC
From:
To:
Hello,

Le 06/08/2015 21:08, Toby Speight a écrit :

Great idea!

Can you propose a patch? That would help a lot.

Bye

#794806#15
Date:
2015-08-10 10:48:55 UTC
From:
To:
0> In article <55C759CB.8070300@gmail.com>,
0> Ludovic Rousseau <URL:mailto:ludovic.rousseau@gmail.com> ("Ludovic") wrote:

Ludovic> Great idea!
Ludovic>
Ludovic> Can you propose a patch? That would help a lot.

I haven't looked at the source at all.  I'm on holiday this week, but
I'll take a look when I return.