Short File name
Posted: Fri Mar 15, 2019 11:37 am
How can i translate a long file name (more than 14 characters) to a short File name ?
example TOTO123456787890 to toto12~1
thanks
example TOTO123456787890 to toto12~1
thanks
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
spath.s{300}
GetShortPathName_(#PB_Compiler_Home +"Examples\Sources\Data\CdPlayer.ico",@spath,300)
Debug spath
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getshortpathnamew wrote:This outcome is also possible with NTFS volumes because there's no guarantee that a short name will exist for a given long name.
To check if the file system supports the 8dot3 specification (dir /x):ts-soft wrote:Attention:https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getshortpathnamew wrote:This outcome is also possible with NTFS volumes because there's no guarantee that a short name will exist for a given long name.
Code: Select all
C:\>dir /x
Volume in drive C is xxxxxxxx
Volume Serial Number is xxxx-xxxx
Directory of C:\Program Files\PureBasic\Examples\Sources - Advanced\Atomic FTP Server
19/12/2018 08:04 PM <DIR> .
19/12/2018 08:04 PM <DIR> ..
09/07/2014 11:20 AM 5,132 ATOMIC~1.PB Atomic FTP Server.pb
19/12/2018 08:04 PM <DIR> FTP
06/10/2007 01:33 PM 944 Readme.txt
Code: Select all
C:\>fsutil 8dot3name set D: 0