Mail Archives: djgpp-workers/1999/11/23/02:34:49
On Mon, 22 Nov 1999, Laurynas Biveinis wrote:
> > > What will happen if "ln -s
> > > a_short.nam a_very_long_name.with.multiple_long_extensions" is done in plain
> > > DOZE?
> >
> > This will fail because the second file name is an invalid name on DOS.
> > So `ln' cannot create it. It's the same as if you replace "ln -s" with
> > "cp".
>
> If the `ln' itself does this check. If you call `symlink()' from your own
> code, it isn't done.
It's not in `ln', it's inside DOS.
When `ln' is about to make the symlink, it eventually calls a DOS
function to create a file. When DOS sees a name such as
a_very_long_name.with.multiple_long_extensions, it fails the call with
ENOENT, because such a name is invalid on DOS filesystems. (The
transparent truncation only works on files that don't use such invalid
constructs, and also don't include characters that DOS doesn't allow
in file names, such as `+', `,', etc.)
The same thing happens if you substitute `cp' for `ln'. Here, too,
`cp's application code doesn't check these things, it's DOS itself
that fails the call to create the target file.
- Raw text -