How can i translate a long file name (more than 14 characters) to a short File name ?
example TOTO123456787890 to toto12~1
thanks
Short File name
Re: Short File name
hi
https://docs.microsoft.com/en-us/window ... tpathnamew
https://docs.microsoft.com/en-us/window ... tpathnamew
Code: Select all
spath.s{300}
GetShortPathName_(#PB_Compiler_Home +"Examples\Sources\Data\CdPlayer.ico",@spath,300)
Debug spath
interested in Cybersecurity..
Re: Short File name
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.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Re: Short File 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
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel