Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I get short name from long name ?
Message
From
12/08/1998 07:32:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/08/1998 06:50:25
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00125906
Message ID:
00125916
Views:
12
>Earlier we used to save files with more than 8+3 charecters for file name and extension. Now we can have long file names (enhanced file descreptions). If I give the long file name , I want the equilant short file name and vice versa.
>
>eg: when you type DIR command at DOS prompt, you get short and long file names.
>
>If I need to use any Windows APIs or DLLs, Pl give the names and functions to retrieve the fiel names.
>
>With Regards
>Satya
lParameters lpFileName
lpFindFileData = space(1024)
declare integer FindFirstFile in win32api ;
    string @lpFileName, string @lpFindFileData
declare integer FindClose in win32api ;
    integer lnHandle

*!*	typedef struct _WIN32_FIND_DATA { // wfd  
*!*	    DWORD dwFileAttributes;
*!*	    FILETIME ftCreationTime;
*!*	    FILETIME ftLastAccessTime;
*!*	    FILETIME ftLastWriteTime;
*!*	    DWORD    nFileSizeHigh;
*!*	    DWORD    nFileSizeLow;
*!*	    DWORD    dwReserved0;
*!*	    DWORD    dwReserved1;
*!*	    TCHAR    cFileName[ MAX_PATH ];
*!*	    TCHAR    cAlternateFileName[ 14 ];
*!*	} WIN32_FIND_DATA;

*!*	typedef struct _FILETIME { // ft  
*!*	    DWORD dwLowDateTime;
*!*	    DWORD dwHighDateTime;
*!*	} FILETIME;

nHandle = FindFirstFile(@lpFileName,@lpFindFileData)
=FindClose(nHandle)
cFilenameInfo = substr(lpFindFileData,45)
cShortName = allt(substr(cFilenameInfo, ;
	at(chr(0),cFilenameInfo,2)-14,14))
? cShortName
For easier access to these plus many other functions visit www.fastwrite.com and check Focus.fll.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform