Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
To: cygwin@cygwin.com
Subject: Resolving symlinks for use with Win32 API functions
From: Jesper Eskilson <jojo@virtutech.se>
Organization: Virtutech AB
Date: 08 Mar 2001 13:28:30 +0100
Message-ID: <u67u254igwh.fsf@rachel.hq.vtech>
Lines: 27
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.2 (Thalia)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii


Hi!

Consider the scenario where you're using Win32 API I/O routines
(CreateFile(), ReadFile(), etc.) to do file I/O, instead of the Cygwin ones
(open(), read(), etc.).  How can you resolve Cygwin symlinks (either new or
old ones) in a Cygwin-program for use with Win32 API routines?

Old ones are fairly easy to parse; just remove the "!<symlink>" string (and
then convert the remaining path using the Cygwin API) but what about new
style symlinks? 

One problem is that Windows shortcuts aren't transparent; actually they're
objects in the mind of Windows Explorer and not a Win32 invention at
all. So, in order to resolve a Windows shortcut, you need to explicitly
call a long sequence of strange functions. There is sample code in MSDN to
do this, however, this code wants to link with shell32.lib and include the
file "shlwapi.h", which is nowever to be found in Cygwin.

Any ideas?

/Jesper
-- 
-------------------------------------------------------------------------
Jesper Eskilson                                         jojo@virtutech.se
Virtutech                                         http://www.virtutech.se
-------------------------------------------------------------------------


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

