RENAME with different disk units
Eli Zaretskii
eliz@delorie.com
Thu Jul 20 08:25:00 GMT 2000
> From: "Orlando P. Hevia" <heviaop@ssdfe.com.ar>
> Date: Thu, 20 Jul 2000 09:29:49 -0300
>
> C FOR DOS DJGPP, THE SAMPLE WORKS IF BOTH UNITS
> C ARE THE SAME AS THE COMMENTED LINE
This is not the right place to post such reports: your problem has
nothing to do with the compiler. The function `rename' is a library
function, so please report any potential bugs to the
comp.os.msdos.djgpp news group.
> C I TRIED THE SAME SOURCE WITH LINUX: THE SAME RESULT
> C OK IF THE SAME DISK, NOT WORKS IF DIFFERENT DISKS.
> C
> C WITH MINGW32 VERSION, THE ROUTINE WORKS OK WITH
> C DIFFERENT DISK UNITS
> C
> C UNTIL NOW I AM USING THE MV (LINUX) AND MV.EXE
> C (DOS-WIN32) TO MOVE THE FILES, VIA CALL SYSTEM
> C
> C
> CHARACTER*60 FILE1,FILE2
> FILE1='D:\\LLL'
> C FILE2='D:\\HEVIA.DBG'
> FILE2='C:\\HEVIA.DBG'
> CALL RENAME(FILE1,FILE2)
> STOP
> END
>
> I don't know if this is a bug, or if this problem can be
> solved.
This is not a bug, but a well-documented intentional behavior.
The documentation of `rename' in the DJGPP library (from the
command line, type "info libc alpha rename" and read there)
says, among other things:
... [the files] must reside on the same logical device (otherwise,
`errno' will be set to EXDEV)
This is so because DJGPP's library emulates the Posix behavior where
a file cannot be renamed between different filesystems.
I don't know why this works with Mingw, but the library used in Mingw
programs is different (in particular, it doesn't claim Posix
compatibility).
More information about the Gcc-bugs
mailing list