From WikiChip
$tempfn identifier - mIRC
< mirc‎ | identifiers
Revision as of 13:08, 17 August 2020 by Maroonbells (talk | contribs) (added $tempfn(path) syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Added: mIRC v7.63
Added on: 17 Aug 2020
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.

See also[edit]