delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/08/24/11:15:35

From: Alain Magloire <alainm AT rcsm DOT ece DOT mcgill DOT ca>
Message-Id: <199908241443.KAA00214@mccoy2.ECE.McGill.CA>
Subject: Re: Real symlinks for DJGPP?
To: djgpp-workers AT delorie DOT com
Date: Tue, 24 Aug 1999 10:43:54 -0400 (EDT)
In-Reply-To: <Pine.SUN.3.91.990822131235.6405Z-100000@is> from "Eli Zaretskii" at Aug 22, 99 01:14:11 pm
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019