coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

Possible improvement of mktemp error message

Open Ecordonnier opened this issue 2 years ago • 3 comments

mktemp requires three 'X' in the pattern argument. In the case where the XXX is missing and the tmpdir option is provided, the uutils-coreutils mktemp error message is a bit cryptic. This error message is better in the GNU version and could be improved in my opinion:

coreutils$ ./target/release/coreutils mktemp --tmpdir foobar
mktemp: failed to create file via template 'foobar/tmp.XXXXXXXXXX': No such file or directory
GNU version:
$ mktemp --tmpdir foobar
mktemp: too few X's in template ‘foobar’

Note that for the version without tmpdir, the error messages are the same in both versions:

GNU version:
coreutils$ mktemp foobar
mktemp: too few X's in template ‘foobar’

$ ./target/release/coreutils mktemp foobar
mktemp: too few X's in template 'foobar'

Ecordonnier avatar Nov 21 '22 10:11 Ecordonnier

That sounds like a good improvement indeed. Would you like to try to fix it?

tertsdiepraam avatar Nov 21 '22 12:11 tertsdiepraam

That sounds like a good improvement indeed. Would you like to try to fix it?

I don't think I'll have time in the coming weeks (maybe later), so if someone wants to work on that feel free to.

Ecordonnier avatar Nov 21 '22 12:11 Ecordonnier

Im working on this. Dont have too much time available, but should be coming soon :)

dmatos2012 avatar Dec 12 '22 21:12 dmatos2012

Fixed in https://github.com/uutils/coreutils/pull/4342

cakebaker avatar Aug 05 '23 15:08 cakebaker