"dos2unix" trying to use bad temporary file name

Robert P. J. Day rpjday at mindspring.com
Sun May 8 14:45:25 UTC 2005


On Sun, 8 May 2005, Robert P. J. Day wrote:

>
>   since bugzilla had nothing obvious to say about "dos2unix", i
> thought i'd ask here.
>
>   i'm using "find" and "dos2unix" to (recursively) convert a pile of C
> source files to proper UNIX format.  partway through the command, i
> start getting errors of the form (actual directory names shortened for
> brevity):
>
> dos2unix a/b/c/file.c
> dos2unix: converting file a/b/c/file.c to UNIX format ...
> dos2unix: problems renaming 'a/b/c/d2utmpRRN784??' to 'a/b/c/file.c'
>           output file remains in 'a/b/c/d2utmpRRN784??'
>
> the problem seems clear -- where you see the '??' in the temp file
> name are actually special characters -- using "hexdump" shows that,
> while the temp files seem to have the correct name, the "dos2unix"
> command is trying to use a filename with the extra octal bytes
>
>   001 017 002
>
> on the end.  in short, because of this extra junk, dos2unix is
> obviously not finding the actual (proper) temp file and failing.  any
> thoughts on where that extra trash is coming from?
>
>   if i run the command in the directory containing the file, it works
> fine.  if i do it from three directories up, failure.  curious.

one additional observation which, as brent butt of "corner gas" would
say, "oh ... well, that in no way explains it."

$ dos2unix a/b/c/d/e/file.c
  (success)

$ cd a
$ dos2unix b/c/d/e/file.c
  (success)

$ cd b
$ dos2unix c/d/e/file.c
  ... above error ... ???

$ cd c
$ dos2unix d/e/file.c
  (success)


duh?

rday




More information about the fedora-list mailing list