delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/05/24/20:59:12

From: condict AT opengroup DOT org (Michael Condict)
Subject: Re: v18 vs v17 compile times....
24 May 1997 20:59:12 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199705231513.LAA06332.cygnus.gnu-win32@postman.opengroup.org>
X-Authentication-Warning: postman.opengroup.org: Host hare.osf.org [130.105.7.99] didn't use HELO protocol
Original-To: Sergey Okhapkin <sos AT prospect DOT com DOT ru>
Original-cc: "gnu-win32 AT cygnus DOT com" <gnu-win32 AT cygnus DOT com>,
"'ap096 AT po DOT cwru DOT edu'" <ap096 AT po DOT cwru DOT edu>, condict AT opengroup DOT org
In-reply-to: Your message of "Thu, 22 May 1997 10:39:54 +0400."
<01BC669C DOT 7C655BC0 AT gater DOT krystalbank DOT msk DOT ru>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

In message <01BC669C DOT 7C655BC0 AT gater DOT krystalbank DOT msk DOT ru>, you write:
> > Somebody else already asked, but I did not see the answer to the question, "Is
> > it (reasonably) easy to build without or turn off symbolic links?"
> 
> I've made some improvements in symlink checking and sent a patch to mr. 
> Noer. My patch checks "system" file attribute symlinks must to have. It 
> doesn't affect non-cygwin programs any way - they knows nothing about 
> symlinks.

Isn't the performance problem with symlinks inherent in the current
design?  They are files without a suffix, therefore without an
identifiable Windows type.  Therefore you have to look at the contents
of the file to see if it is a symlink.  And checking the system
attribute is not a complete solution to the performance problem.  It
just means that you don't have to check the contents of the file unless
it has the system attribute.  But you still have to always perform an
extra operation to check the system attribute.  And for the many non-
symlink files that have the system attribute, you still have to read
the file to see if it's a symlink.

I'd like to step back and point out that Windows 95 / NT 4 already *have*
symlinks.  They are ".lnk" files for folders, data files and Win32 programs,
and ".pif" files for 16-bit programs.  They have all the power of UNIX
symlinks in what information is stored in them, and more.

Now it's true that Windows makes very poor use of these symlinks,
allowing them to have meaning only if you double-click on them in an
Explorer window or feed them to the "Run" menu or the "start" command.
You can't "cd" through them or print the contents of the file to which
they point using the "type" command.  But this is no reason that Cygnus
Win32 can't endow them with the full power of UNIX symlinks.  This would
be a solution that does not require reading a symlink file.

It's also much better integrated with Windows.  Wouldn't it be nice if
you could navigate through Cygnus Win32 symlinks using Explorer?  When
you've made c:/bin be a symlink/shortcut to the Cygnus godawfully named
".../H-i386-cygwin32/bin" directory, wouldn't it be nice if you could
type e.g. "/bin/bash" to the Start / Run window, and have it start up
bash?

Here are some details of how such links could work:

	1) Readdir, when returning the names of files in a directory,
	   should delete the suffix ".lnk" or ".pif", if present.

	2) In the open syscall, if an attempt to open a file fails with
	   a "not found" error, open should suffix ".lnk" and try
	   again.  If that fails, it should suffix ".pif" and try
	   again.  If either of these succeeds, open should then read
	   the shortcut file, find the path name of the target, and do a
	   Win32 open of the target file.  This will slow down the
	   processing of sym links a bit (because a failed open has to
	   take place first), but allows non-symlink files to be
	   processed without any overhead added by the symlink code.

	3) The other syscalls that take a pathname and are supposed to
	   follow symlinks (e.g. chdir, stat), should select the target
	   file or folder similarly to the algorithm used by open.

Comments?

Michael Condict			m DOT condict AT opengroup DOT org
The Open Group Research Inst.	(617) 621-7349
11 Cambridge Center
Cambridge, MA 02142
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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