This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: Getting short name from long name?
- To: James Pearson <jcpearso at ge dot ucl dot ac dot uk>
- Subject: Re: Getting short name from long name?
- From: "John D. Rogers" <jrogers at cascadenet dot com>
- Date: Wed, 04 Feb 1998 15:34:59 -0500
- CC: gnu-win32 at cygnus dot com
- References: <16070.886592112@ps.ucl.ac.uk>
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.pearson@ge.ucl.ac.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@cygnus.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@cascadenet.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".