From WikiChip
Difference between revisions of "mirc/identifiers/$longfn"
(→Example) |
Maroonbells (talk | contribs) (Add'l examples) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{mirc title|$longfn Identifier}}'''$longfn(path)''' returns long pathname\filename version of a short filename. | ||
− | |||
− | |||
== Synopsis == | == Synopsis == | ||
<source lang="mIRC"> | <source lang="mIRC"> | ||
− | $longfn(path)</source> | + | $longfn( < path | filename | path\filename > )</source> |
== Parameters == | == Parameters == | ||
+ | '''* Path''' = ''The absolute/relative directory/path and/or filename that you want to ensure is a long filename.'' | ||
− | ''' | + | '''NOTE:''' |
+ | * Looks for target the same way $isfile does: If relative path or no-path is provided, it assumes the location is relative to $mircdir | ||
+ | * In order to return the long version of the path, the path MUST exist. | ||
+ | * $longfn alters upper/lower case of individual folders and the filename only when the token needs to be changed | ||
+ | * To ensure foldernames+filename are all the correct case-sensitive spellings, must use $longfn($shortfn(target)) | ||
== Properties == | == Properties == | ||
− | |||
None | None | ||
== Examples == | == Examples == | ||
− | <source lang="mIRC">//echo -a $longfn($mircdir)</source> | + | <source lang="mIRC">//echo -a $shortfn($mircdir) -> $longfn($shortfn($mircdir))</source> |
− | It | + | It returns the long path version of the specified directory. "'''C:\Users\westor\Documents\mIRC\'''" |
+ | <source lang="mIRC"> | ||
+ | Assuming folder C:\PROGRA~1\ is the short alias of C:\Program Files\ and these filenames exist: | ||
+ | C:\Program Files\7-Zip\readme.txt | ||
+ | C:\Program Files\7-Zip\Uninstall.exe | ||
− | + | //echo -a $longfn( C:\Progra~1\7-ZIP\README.txt ) | |
+ | returns: C:\Program Files\7-Zip\readme.txt | ||
+ | The case of '7-ZIP' and 'README' were fixed because they were the case-insensitive equivalents of their values within $shortfn | ||
− | + | //echo -a $longfn( C:\ProgRam fiLes\7-ZIP\UnInStall.eXe ) | |
+ | returns: C:\ProgRam fiLes\7-Zip\UnInStall.eXe | ||
+ | The case of 'program files' and 'uninstall.exe' were not changed because they were already the case-insensitive equivalents of the long filename | ||
− | + | To ensure the entire path\filename has the correct case-sensitive spelling, use the $lonfn of the $shortfn of the target: | |
+ | //echo -a $Longfn($shortfn( C:\ProgRam fiLes\7-zIP\UnInStall.eXe )) | ||
+ | Returns: C:\Program Files\7-Zip\Uninstall.exe | ||
+ | </source> | ||
== Compatibility == | == Compatibility == | ||
{{mIRC compatibility|5.7}} | {{mIRC compatibility|5.7}} | ||
− | == See | + | == See also == |
− | |||
− | |||
* {{mIRC|$exists}} | * {{mIRC|$exists}} | ||
* {{mIRC|$isdir}} | * {{mIRC|$isdir}} | ||
+ | * {{mIRC|$isfile}} | ||
* {{mIRC|$mircdir}} | * {{mIRC|$mircdir}} | ||
+ | * {{mIRC|$shortfn}} | ||
+ | {{mIRC identifier list}} | ||
+ | [[Category:mIRC identifiers|longfn]] |
Latest revision as of 16:16, 8 December 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$longfn(path) returns long pathname\filename version of a short filename.
Synopsis[edit]
$longfn( < path | filename | path\filename > )
Parameters[edit]
* Path = The absolute/relative directory/path and/or filename that you want to ensure is a long filename.
NOTE:
- Looks for target the same way $isfile does: If relative path or no-path is provided, it assumes the location is relative to $mircdir
- In order to return the long version of the path, the path MUST exist.
- $longfn alters upper/lower case of individual folders and the filename only when the token needs to be changed
- To ensure foldernames+filename are all the correct case-sensitive spellings, must use $longfn($shortfn(target))
Properties[edit]
None
Examples[edit]
//echo -a $shortfn($mircdir) -> $longfn($shortfn($mircdir))
It returns the long path version of the specified directory. "C:\Users\westor\Documents\mIRC\"
Assuming folder C:\PROGRA~1\ is the short alias of C:\Program Files\ and these filenames exist: C:\Program Files\7-Zip\readme.txt C:\Program Files\7-Zip\Uninstall.exe //echo -a $longfn( C:\Progra~1\7-ZIP\README.txt ) returns: C:\Program Files\7-Zip\readme.txt The case of '7-ZIP' and 'README' were fixed because they were the case-insensitive equivalents of their values within $shortfn //echo -a $longfn( C:\ProgRam fiLes\7-ZIP\UnInStall.eXe ) returns: C:\ProgRam fiLes\7-Zip\UnInStall.eXe The case of 'program files' and 'uninstall.exe' were not changed because they were already the case-insensitive equivalents of the long filename To ensure the entire path\filename has the correct case-sensitive spelling, use the $lonfn of the $shortfn of the target: //echo -a $Longfn($shortfn( C:\ProgRam fiLes\7-zIP\UnInStall.eXe )) Returns: C:\Program Files\7-Zip\Uninstall.exe
Compatibility[edit]
Added: mIRC v5.7
Added on: 02 Feb 2000
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also[edit]
mIRC identifier list