delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/02/04/16:11:19

From: jrogers AT cascadenet DOT com (John D. Rogers)
Subject: Re: Getting short name from long name?
4 Feb 1998 16:11:19 -0800 :
Message-ID: <34D8D0F3.67D0.cygnus.gnu-win32@cascadeinc.com>
References: <16070 DOT 886592112 AT ps DOT ucl DOT ac DOT uk>
Mime-Version: 1.0
To: James Pearson <jcpearso AT ge DOT ucl DOT ac DOT uk>
Cc: gnu-win32 AT cygnus DOT com

James Pearson wrote:
> 
> Is there any way I can get the short filename from a long filename using
> gnu-win32 on Win95?
> 
> For example, using readdir() gives the long filename as part of the
> returned struct dirent, but I also need to know its short version.
> 
> Is this possible?
> 
> Thanks
> 
> James Pearson
> +------------------------------------------------------------------------+
> Dept. Geomatic Engineering              Email: j DOT pearson AT ge DOT ucl DOT ac DOT uk
> University College London                 WWW: http://www.ge.ucl.ac.uk
> Gower Street
> London  WC1E 6BT
> England
> -
> 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".

I don't know if this will help you or not, but the Win32 API has a
function called GetShortPathName.  The prototype is : 

DWORD GetShortPathName(LPCTSTR lpszLongPath,	// points to a
null-terminated path string
    			LPTSTR lpszShortPath,	// points to a buffer to receive the
null-terminated short form of the path 
    			DWORD cchBuffer 	// specifies the size of the buffer pointed to
by lpszShortPath
   );

Hope you find this useful!
 
John D. Rogers
jrogers AT cascadenet DOT com
-
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