Files on Windows generally have a "short" name that is compatible with legacy software (i.e. DOS, Windows 3.x Applications). It is limited to the old DOS "8.3" schema and contains no spaces, no tricky characters, just a subset of printable ASCII.
Demo:
C:\>mkdir temp
C:\>cd temp
C:\temp>echo hi > "foo bar.batz"
C:\temp>echo hello > "metäl ümläüts äre silly.öpiniön"
C:\temp>dir /x
Volume in drive C is System
Volume Serial Number is D4F2-C5FF
Directory of C:\temp
18.03.2018 10:56 <DIR> .
18.03.2018 10:56 <DIR> ..
18.03.2018 10:54 5 FOOBAR~1.BAT foo bar.batz
18.03.2018 10:56 8 METLML~1.PIN metäl ümläüts äre sil
+ly.öpiniön
2 File(s) 13 bytes
2 Dir(s) 56.432.050.176 bytes free
C:\temp>
Those names are not limited to legacy applications. Any application can use them, including perl:
C:\temp>perl -pe 1 foobar~1.bat metlml~1.pin
hi
hello
C:\temp>
Another, unrelated benefit of those legacy aliases is that they tend to be shorter than the original name. This can be useful to handle files with ridiculously long names, longer than Windows' limits usually allow. See deepcopy for details.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|