Mail Archives: djgpp-workers/1999/08/26/04:17:09
Eli Zaretskii wrote:
> On Tue, 24 Aug 1999, Laurynas Biveinis wrote:
>
> > I got a little bit confused by current symlink() code. The reason -
> > symlink() uses helper function is_v2_prog(), which returns 1 for
> > v2 DJGPP program, 0 for any other program and -1 for anything else.
> > The main symlink() code calls this function to determine the type
> > of linked file. And my question is - why symlink() code checks
> > only for return value 0, and does not handle -1 ?
>
> -1 means that the file doesn't exist. It is perfectly valid to create a
Or the file exists, but is not recognized executable :
is_v2_prog("c:/djgpp/bin/gcc.exe") returns 1,
is_v2_prog("c:/command.com") returns -1,
is_v2_prog("c:/notexist.exe") returns -1,
is_v2_prog("c:/config.sys") returns 0.
> > Are there
> > any reasons for keeping current code, which e.g. executes silently
> > symlink("c:/io.sys", "c:/test.exe") and produces not working
> > test.exe file?
>
> This test.exe will work once the source of the link is created. This is
> how symlinks work on Unix: you can say "ln -s foo bar" and have `bar'
> created even thow `foo' does not exist. The link `bar' is useless in
> this case as long as `foo' doesn't exist.
Yes, but that case symlink("c:/command.com", "c:/test.exe"), where test.exe
is produced, pointing to existing command.com and not working? Should be
these cases catched ?
Laurynas Biveinis
- Raw text -