From WikiChip
Difference between revisions of "mirc/identifiers/$file"
(Added $file identifier) |
|||
| Line 1: | Line 1: | ||
| − | $file | + | {{mirc title|$file Identifier}}'''$file''' will return information about a specified file. If no .property is specified, the size in bytes will be returned by default. |
| − | + | ||
| + | == Synopsis == | ||
| + | <pre>$file(filename)[.property]</pre> | ||
| + | |||
| + | == Parameters == | ||
| + | <span style="display: inline-block; width: 75px;">'''filename'''</span>The filename or directory to any local or networked resource, optionally including absolute or relative path (relative to [[$scriptdir]]). | ||
| + | |||
| + | == Properties == | ||
| + | {| class="wikitable" style="margin-left: 75px;" | ||
| + | |- | ||
| + | ! Property !! Description | ||
| + | |- | ||
| + | | '''.size''' || Returns the file's size in bytes. (default) (see: [[$bytes]]) | ||
| + | |- | ||
| + | | '''.ctime''' || Returns the file's creation time. (see: [[$asctime]]) | ||
| + | |- | ||
| + | | '''.mtime''' || Returns the file's modification time. (see: [[$asctime]]) | ||
| + | |- | ||
| + | | '''.atime''' || Returns the file's last access time. (see: [[$asctime]]) | ||
| + | |- | ||
| + | | '''.shortfn''' || Returns the file's short filename (if it has one). | ||
| + | |- | ||
| + | | '''.longfn''' || Returns the file's long filename. | ||
| + | |- | ||
| + | | '''.attr''' || Returns the file's attributes. | ||
| + | |- | ||
| + | | '''.sig''' || Checks digital signature of an executable/DLL file. (Returns: ok, fail, none) | ||
| + | |- | ||
| + | | '''.version''' || Returns the file's ''file version'' if executable/DLL. | ||
| + | |- | ||
| + | | '''.product''' || Returns the file's ''product version'' if executable/DLL. | ||
| + | |- style="vertical-align:top;" | ||
| + | | '''.flags''' || Returns the file's ''file flags'' if executable/DLL, as explained below. | ||
| + | The value will be a combination bitmask that specifies the compile time attributes of the file. | ||
| + | '''1: DEBUG''' - The file contains debugging information or is compiled with debugging features enabled. | ||
| + | '''2: PRERELEASE''' - The file is a development version, not a commercially released product. | ||
| + | '''4: PATCHED''' - The file has been modified and is not identical to the original shipping file of the same version number. | ||
| + | '''8: PRIVATEBUILD''' - The file was not built using standard release procedures. | ||
| + | '''16: INFOINFERRED''' - The file's version structure was created dynamically; therefore, some of the members in this structure may be empty or incorrect. | ||
| + | '''32: SPECIALBUILD''' - The file was built by the original company using standard release procedures but is a variation of the normal file of the same version number. | ||
| + | See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms646997(v=vs.85).aspx | ||
| + | |} | ||
| + | |||
| + | == Example == | ||
| + | '''Tells you some information about mIRC's executable.''' | ||
| + | <source lang="mIRC">//echo -a $mircexe is $bytes($file($mircexe),3).suf and was installed on $asctime($file($mircexe).ctime)</source> | ||
| + | |||
| + | '''Some more information about mIRC's executable.''' | ||
| + | <source lang="mIRC">//echo -a My copy of mIRC appears to be $iif($file($mircexe).sig == ok,valid.,hacked!)</source> | ||
| + | |||
| + | == Compatibility == | ||
| + | {{mIRC compatibility|5.71}} | ||
| + | |||
| + | == See Also == | ||
| + | {{mIRC|File Handling}} | ||
| + | {{mIRC identifier list}} | ||
| + | |||
| + | [[Category:mIRC identifiers|file]] | ||
Revision as of 15:03, 27 September 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$file will return information about a specified file. If no .property is specified, the size in bytes will be returned by default.
Synopsis
$file(filename)[.property]
Parameters
filenameThe filename or directory to any local or networked resource, optionally including absolute or relative path (relative to $scriptdir).
Properties
| Property | Description |
|---|---|
| .size | Returns the file's size in bytes. (default) (see: $bytes) |
| .ctime | Returns the file's creation time. (see: $asctime) |
| .mtime | Returns the file's modification time. (see: $asctime) |
| .atime | Returns the file's last access time. (see: $asctime) |
| .shortfn | Returns the file's short filename (if it has one). |
| .longfn | Returns the file's long filename. |
| .attr | Returns the file's attributes. |
| .sig | Checks digital signature of an executable/DLL file. (Returns: ok, fail, none) |
| .version | Returns the file's file version if executable/DLL. |
| .product | Returns the file's product version if executable/DLL. |
| .flags | Returns the file's file flags if executable/DLL, as explained below.
The value will be a combination bitmask that specifies the compile time attributes of the file. 1: DEBUG - The file contains debugging information or is compiled with debugging features enabled. 2: PRERELEASE - The file is a development version, not a commercially released product. 4: PATCHED - The file has been modified and is not identical to the original shipping file of the same version number. 8: PRIVATEBUILD - The file was not built using standard release procedures. 16: INFOINFERRED - The file's version structure was created dynamically; therefore, some of the members in this structure may be empty or incorrect. 32: SPECIALBUILD - The file was built by the original company using standard release procedures but is a variation of the normal file of the same version number. See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms646997(v=vs.85).aspx |
Example
Tells you some information about mIRC's executable.
//echo -a $mircexe is $bytes($file($mircexe),3).suf and was installed on $asctime($file($mircexe).ctime)
Some more information about mIRC's executable.
//echo -a My copy of mIRC appears to be $iif($file($mircexe).sig == ok,valid.,hacked!)
Compatibility
Added: mIRC v5.71
Added on: 07 May 2000
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See Also
mIRC identifier list