rmlint icon indicating copy to clipboard operation
rmlint copied to clipboard

keep dir timestamps fails busybox's mktemp

Open freezingDaniel opened this issue 1 year ago • 0 comments

Busybox expects the template to end with XXXXXX and fails (exitcode 1) but the script proceeds running, printing

touch: : No such file or directory
touch: can't stat '': No such file or directory
rm: can't remove '': No such file or directory

https://elixir.bootlin.com/busybox/latest/source/coreutils/mktemp.c

Possible solutions might include:

  • Checking for successful creation STAMPFILE/tmpfile file
  • (Re)moving other file endings from the template
  • Additionally maybe by simply using mktemp without a template or as mktemp -p if the file is to be created in the working directory as oppose to /tmp/

https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/lib/formats/sh.sh#L373 https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/.format.sh#L15



Also out of interest is there a reason why the file is deleted as part of the stamping? https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/lib/formats/sh.sh#L271 Could the file not created by the variable initialization be used and then delete only as part of the END OF AUTOGENERATED OUTPUT section? https://github.com/sahib/rmlint/blob/a807253e11529038771dfd2262047bee65d8053c/lib/formats/sh.c.in#L58

freezingDaniel avatar Jun 11 '23 04:06 freezingDaniel