Maroonbells (talk | contribs) (Create content for empty page) |
m (→Compatibility: Remove extra version.) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{mirc title|$tempfn | + | {{mirc title|$tempfn identifier}}'''$tempfn''' returns a temporary filename in the {{mIRC|$mircdir}} using the same filename mask used by mIRC internally, such as for the {{mIRC|/write}} command. Now accepts an optional pathname as an alternate folder location. |
− | |||
− | |||
== Synopsis == | == Synopsis == | ||
<pre>$tempfn</pre> | <pre>$tempfn</pre> | ||
− | + | <pre>$tempfn([path])</pre> | |
== Parameters == | == Parameters == | ||
None | None | ||
+ | or | ||
+ | [path] = absolute or relative foldername for the temp file. If path not provided, default is $mircdir, and any path provided MUST exist. If Parenthesis is used is blank path, returns $null. | ||
+ | == Properties == | ||
+ | None | ||
+ | == Example == | ||
+ | <pre>//echo -a $tempfn</pre> | ||
− | + | It does not create the disk filename, but offers the string as a "safe" filename that can be used without it already existing as a disk file or foldername. | |
+ | |||
+ | The string returned is $mircdir $+ mirc $+ $rand(0,$calc(2^31-2)) $+ .tm_ | ||
− | + | '''Note:''' The filename mask is the same used internally by mIRC for disk write fuctions, such as in the /write command. | |
− | / | ||
− | |||
− | + | <pre>//echo -a $tempfn(temp)</pre> | |
+ | Same except the string lists the filename's path as being in the temp subfolder beneath $mircdir. Halts with error if that foldername doesn't exist. Handles strings like ".." or "c:" or "\path" the same way as $findfile. | ||
− | + | It is up to the user to use a folder where you have write permissions for actually creating the file. If D: is a DVD drive, $tempfn(D:\) returns a string containing D:\ as the path, even if the disk write would fail. | |
− | |||
== Compatibility == | == Compatibility == | ||
Line 25: | Line 29: | ||
== See also == | == See also == | ||
* {{mIRC|$mircdir}} | * {{mIRC|$mircdir}} | ||
− |
Latest revision as of 18:18, 23 January 2024
$tempfn returns a temporary filename in the $mircdir using the same filename mask used by mIRC internally, such as for the /write command. Now accepts an optional pathname as an alternate folder location.
Synopsis[edit]
$tempfn
$tempfn([path])
Parameters[edit]
None or [path] = absolute or relative foldername for the temp file. If path not provided, default is $mircdir, and any path provided MUST exist. If Parenthesis is used is blank path, returns $null.
Properties[edit]
None
Example[edit]
//echo -a $tempfn
It does not create the disk filename, but offers the string as a "safe" filename that can be used without it already existing as a disk file or foldername.
The string returned is $mircdir $+ mirc $+ $rand(0,$calc(2^31-2)) $+ .tm_
Note: The filename mask is the same used internally by mIRC for disk write fuctions, such as in the /write command.
//echo -a $tempfn(temp)
Same except the string lists the filename's path as being in the temp subfolder beneath $mircdir. Halts with error if that foldername doesn't exist. Handles strings like ".." or "c:" or "\path" the same way as $findfile.
It is up to the user to use a folder where you have write permissions for actually creating the file. If D: is a DVD drive, $tempfn(D:\) returns a string containing D:\ as the path, even if the disk write would fail.
Compatibility[edit]
Added: mIRC v7.46
Added on: 01 Aug 2016
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.