Mail Archives: djgpp-workers/1999/08/24/11:15:35
Bonjour
: On Sun, 22 Aug 1999, Laurynas Biveinis wrote:
:
: > 2) open function checks for symlink file format, and if
: > the file appears to be symlink, open real file instead.
:
: I presume you realize how much this would harm performance of file I/O?
: The above means that every call to `_open' will have to read the file, in
: order to know whether it is a link or a regular file, even if the
: application only wants to write to the file. This also means that
: `_open' will have to call `stat', or some of its subroutines (because
: some special files, like character devices, e.g. CON or PRN, cannot be
: safely read). A huge performance hit.
:
: Is this really justified? What are the advantages of supporting symlinks
: on a filesystem that doesn't know about symlinks?
:
: > For supporting symlinks to directories chdir() should be
: > adjusted too.
:
: And `opendir', and `findfirst', and `spawnv'.
:
: > I'm waiting for advices.
:
: I think we need to see the advantages of this before we can decide if
: this is worth the hassle. Can you tell what will we gain?
Disks space ? A new tool for file navigation ? Another chance to learn
and break the world ? ;-)
I suppose inode, are not available so one could quickly check the type
of the file.
The pathname interpretation should probably be "adjust"(realpath(),..)
to prepend or change the resulting pathname if the link points to
an absolute or relative path.
When you say chdir() should be adjust, how ? see two different
behaviours below (Solaris vs GNU/Linux) of chdir() :
# uname -sr
SunOS 5.5.1
# cd /tmp
# mkdir -p Me/You/Him
# cd Me
# ln -s You/Him Her
# ls -l
total 32
lrwxrwxrwx 1 alainm vlsi 7 août 24 10:05 Her -> You/Him/
drwxr-xr-x 3 alainm vlsi 105 août 24 10:05 You/
# cd Her
# pwd
/tmp/Me/You/Him
# cd ..
# pwd
/tmp/Me/You
$ uname -rs
Linux 2.2.5-15
$ cd /tmp
tmp]$ mkdir -p Me/You/Him
tmp]$ cd Me
$ ln -s You/Him Her
$ ls -l
total 1
lrwxrwxrwx 1 alain techies 7 Aug 24 10:14 Her -> You/Him
drwxr-xr-x 3 alain techies 1024 Aug 24 10:13 You
$ pwd
/tmp/Me
$ cd Her
$ pwd
/tmp/Me/Her
$ cd ..
$ pwd
/tmp/Me
--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!
- Raw text -