From WikiChip
Editing mirc/identifiers/$longfn

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
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 | filename | path\filename > )</source>
+
$longfn(path)</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 ==
Line 19: Line 13:
  
 
== Examples ==
 
== Examples ==
<source lang="mIRC">//echo -a $shortfn($mircdir) -> $longfn($shortfn($mircdir))</source>
+
<source lang="mIRC">//echo -a $longfn($shortfn($mircdir))</source>
  
It returns the long path version of the specified directory. "'''C:\Users\westor\Documents\mIRC\'''"  
+
It will return for example the "'''C:\Users\westor\Documents\mIRC\'''" long path version of the specified direction.
<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 )
+
<source lang="mIRC">//echo -a $longfn(C:\Users\westor\DOCUME~1\mIRC\)</source>
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 )
+
It will return "'''C:\Users\westor\Documents\mIRC\'''" long path version of the short version one that you have specified.
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:
+
'''NOTE:''' In order to return the long version of the path, the path MUST be exists.
//echo -a $Longfn($shortfn( C:\ProgRam fiLes\7-zIP\UnInStall.eXe ))
 
Returns: C:\Program Files\7-Zip\Uninstall.exe
 
</source>
 
  
 
== Compatibility ==
 
== Compatibility ==
Line 46: Line 29:
 
* {{mIRC|$exists}}
 
* {{mIRC|$exists}}
 
* {{mIRC|$isdir}}
 
* {{mIRC|$isdir}}
* {{mIRC|$isfile}}
 
 
* {{mIRC|$mircdir}}
 
* {{mIRC|$mircdir}}
 
* {{mIRC|$shortfn}}
 
* {{mIRC|$shortfn}}
 
{{mIRC identifier list}}
 
{{mIRC identifier list}}
 
[[Category:mIRC identifiers|longfn]]
 
[[Category:mIRC identifiers|longfn]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)