From WikiChip
Difference between revisions of "mirc/identifiers/$longfn"
< mirc‎ | identifiers

(Created page with " {{mirc title|$longfn Identifier}}'''$longfn(path)''' Returns long version of a short filename. == Synopsis == <source lang="mIRC"> $longfn(path)</source> == Parameters ==...")
 
(Add'l examples)
 
(4 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.
  
 
{{mirc title|$longfn Identifier}}'''$longfn(path)''' Returns long 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.''
  
'''* Path''' = ''The direction/path that you want to check for.''
+
'''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
  
== Example ==
+
== Examples ==
<source lang="mIRC">//echo -a $longfn($mircdir)</source>
+
<source lang="mIRC">//echo -a $shortfn($mircdir) -> $longfn($shortfn($mircdir))</source>
  
It will return for example the "'''C:\Users\westor\Documents\mIRC\'''" long path version of the specified direction.
+
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
  
<source lang="mIRC">//echo -a $longfn(C:\Users\westor\DOCUME~1\mIRC\)</source>
+
//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
  
It will return "'''C:\Users\westor\Documents\mIRC\'''" long path version of the short version one that you have specified.
+
//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
  
'''NOTE:''' In order to return the long version of the path, the path MUST be exists.
+
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 Also ==
+
== See also ==
[[Category:MIRC identifiers]]
 
* {{mIRC|$shortfn}}
 
 
* {{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 17:16, 8 December 2017

$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]

[Expand]
v · d · e mIRC identifier list