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

(Properties)
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{mirc title|$file Identifier}}'''$file''' can be used in two ways:
 
{{mirc title|$file Identifier}}'''$file''' can be used in two ways:
  
'''$file(filename).prop''' return information about a specified file. If no .property is specified, the size in bytes will be returned by default.
+
* '''$file(filename).prop''' return information about a specified file. If no .property is specified, the size in bytes will be returned by default.
'''$file="title" dir''' this is an old syntax, display the select file dialog, this has been replaced by {{mIRC|$sfile}}
+
 
 +
* '''$file="title" dir''' this is an old, deprecated syntax, display the select file dialog, {{Deprecated feature|new={{mIRC|$sfile}}}}
  
  
Line 10: Line 11:
  
 
== Parameters ==
 
== Parameters ==
* '''filename''' - The filename or directory to any local or networked resource, optionally including absolute or relative path (relative to [[$scriptdir]]).
+
* '''filename''' - The filename or directory to any local or networked resource, optionally including absolute or relative path (relative to {{mIRC|$mircdir}})
 
* '''title''' - the title of the dialog, the quote are optional if you don't use space, this parameter is optional: //echo -a $file c:\*.txt
 
* '''title''' - the title of the dialog, the quote are optional if you don't use space, this parameter is optional: //echo -a $file c:\*.txt
 
* '''dir''' - the directory you want to display, you can put a file at the end which will be used to fill the 'filename' field in the dialog
 
* '''dir''' - the directory you want to display, you can put a file at the end which will be used to fill the 'filename' field in the dialog
  
 
== Properties ==
 
== Properties ==
* '''.size''' - Returns the file's size in bytes. (default) (see: [[$bytes]])
+
When new $file(filename) is used, you can use the following properties:
* '''.ctime''' - Returns the file's creation time. (see: [[$asctime]])
+
* '''.size''' - Returns the file's size in bytes. (default) (see: {{mIRC|$bytes}})
* '''.mtime''' - Returns the file's modification time. (see: [[$asctime]])
+
* '''.ctime''' - Returns the file's creation time. (see: {{mIRC|$asctime}})
* '''.atime''' - Returns the file's last access time. (see: [[$asctime]])
+
* '''.mtime''' - Returns the file's modification time. (see: {{mIRC|$asctime}})
 +
* '''.atime''' - Returns the file's last access time. (see: {{mIRC|$asctime}})
 
* '''.shortfn''' - Returns the file's short filename (if it has one).
 
* '''.shortfn''' - Returns the file's short filename (if it has one).
 
* '''.longfn''' - Returns the file's long filename.
 
* '''.longfn''' - Returns the file's long filename.
* '''.attr''' - Returns the file's attributes.
+
* '''.attr''' - Returns the file (or folder)'s attributes. the returned value is a concatenation of letters representing the attributes, it will contain a:
 +
** '''a''' - archive flag. Is set during normal file-modifying or dir-creation as an indicator to backup programs the file has changed since the last backup, for use with incremental backups. All backups clear this flag for files they archive.
 +
** '''c''' - if file/folder is compressed.
 +
** '''d''' - if it is a directory.
 +
** '''e''' - if the file/folder is encrypted
 +
** '''h''' - if the file/folder is hidden.
 +
** '''n''' - if the file/folder is normal, not indexed.
 +
<!--- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-sparse --->
 +
** '''o''' - the file data is physically moved to offline storage (Remote Storage).
 +
** '''p''' - if the file is sparse.
 +
** '''r''' - if the file/folder is in read only mode
 +
** '''s''' - if the file/folder is a system file/folder
 +
** '''t''' - a file or directory that has an associated reparse point, or a file that is a symbolic link.
 +
** '''x''' - if you're archiving (a) but are not allowing the indexing of the file/folder's content
 +
** '''y''' - if the file is temporary
 
* '''.sig''' - Checks digital signature of an executable/DLL file. (Returns: ok, fail, none)
 
* '''.sig''' - Checks digital signature of an executable/DLL file. (Returns: ok, fail, none)
 +
* '''.ext''' - Returns the extention of the filename if a filename is used, $null otherwise
 +
* '''.path''' - if a folder is passed, returns the path containing that folder ($file(C:\windows\).path is C:\), if a filename is used, returns the path containing the filename.
 +
* '''.name''' - Returns the name of the folder if a folder is used, or the name of the file without the extention if a filename is used
 
* '''.version''' - Returns the file's ''file version'' if executable/DLL.
 
* '''.version''' - Returns the file's ''file version'' if executable/DLL.
 
* '''.product''' - Returns the file's ''product version'' if executable/DLL.
 
* '''.product''' - Returns the file's ''product version'' if executable/DLL.
Line 45: Line 64:
  
 
== See Also ==
 
== See Also ==
{{mIRC|File Handling}}
 
 
{{mIRC identifier list}}
 
{{mIRC identifier list}}
  
 
[[Category:mIRC identifiers|file]]
 
[[Category:mIRC identifiers|file]]

Latest revision as of 09:15, 25 September 2022

$file can be used in two ways:

  • $file(filename).prop return information about a specified file. If no .property is specified, the size in bytes will be returned by default.
  • $file="title" dir this is an old, deprecated syntax, display the select file dialog, Note: This feature has essentially been replaced by $sfile.


Synopsis[edit]

$file(filename).prop 
$file="title" dir

Parameters[edit]

  • filename - The filename or directory to any local or networked resource, optionally including absolute or relative path (relative to $mircdir)
  • title - the title of the dialog, the quote are optional if you don't use space, this parameter is optional: //echo -a $file c:\*.txt
  • dir - the directory you want to display, you can put a file at the end which will be used to fill the 'filename' field in the dialog

Properties[edit]

When new $file(filename) is used, you can use the following properties:

  • .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 (or folder)'s attributes. the returned value is a concatenation of letters representing the attributes, it will contain a:
    • a - archive flag. Is set during normal file-modifying or dir-creation as an indicator to backup programs the file has changed since the last backup, for use with incremental backups. All backups clear this flag for files they archive.
    • c - if file/folder is compressed.
    • d - if it is a directory.
    • e - if the file/folder is encrypted
    • h - if the file/folder is hidden.
    • n - if the file/folder is normal, not indexed.
    • o - the file data is physically moved to offline storage (Remote Storage).
    • p - if the file is sparse.
    • r - if the file/folder is in read only mode
    • s - if the file/folder is a system file/folder
    • t - a file or directory that has an associated reparse point, or a file that is a symbolic link.
    • x - if you're archiving (a) but are not allowing the indexing of the file/folder's content
    • y - if the file is temporary
  • .sig - Checks digital signature of an executable/DLL file. (Returns: ok, fail, none)
  • .ext - Returns the extention of the filename if a filename is used, $null otherwise
  • .path - if a folder is passed, returns the path containing that folder ($file(C:\windows\).path is C:\), if a filename is used, returns the path containing the filename.
  • .name - Returns the name of the folder if a folder is used, or the name of the file without the extention if a filename is used
  • .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, the value is 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 for more informations.

Example[edit]

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[edit]

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[edit]

v · d · e mIRC identifier list

$ $$, $, $0, $1-, $!, $&, $*, $+, $++, $?

A $abook, $abs, $acos, $active, $activecid, $activewid, $adate, $address, $addtok, $addtokcs, $agent, $agentname, $agentstat, $agentver, $alias, $and, $anick, $ansi2mirc, $aop, $appactive, $appstate, $asc, $asctime, $asin, $atan, $atan2, $auto, $avoice, $away, $awaymsg, $awaytime

B $banlist, $banmask, $base, $beta, $bfind, $bindip, $bitoff, $biton, $bits, $bnick, $bvar, $bytes

C $calc, $caller, $cancel, $cb, $cd, $ceil, $chan, $chanmodes, $channel, $chantypes, $chat, $chr, $cid, $clevel, $click, $cmdbox, $cmdline, $cnick, $color, $colour, $com, $comcall, $comchan, $comchar, $comerr, $compact, $compress, $comval, $cos, $cosh, $count, $countcs, $cr, $crc, $creq, $crlf, $ctime, $ctimer, $ctrlenter

D $date, $day, $daylight, $dbuh, $dbuw, $dccignore, $dccport, $dde, $ddename, $debug, $decode, $decompress, $deltok, $devent, $dialog, $did, $didreg, $didtok, $didwm, $dir, $disk, $dlevel, $dll, $dllcall, $dname, $dns, $donotdisturb, $dqwindow, $duration

E $ebeeps, $editbox, $email, $emailaddr, $encode, $envvar, $error, $eval, $evalnext, $event, $eventid, $eventparms, $exists, $exiting

F $false, $feof, $ferr, $fgetc, $file, $filename, $filtered, $find, $finddir, $finddirn, $findfile, $findfilen, $findtok, $findtokcs, $fline, $flinen, $floor, $font, $fopen, $fread, $fromeditbox, $fserv, $fserve, $fulladdress, $fulldate, $fullname, $fullscreen

G $get, $getdir, $getdot, $gettok, $gmt, $group

H $halted, $hash, $height, $hfile, $hfind, $hget, $highlight, $hmac $hmatch, $hnick, $host, $hotline, $hotlinepos, $hotlink, $hotp, $hregex, $hypot

I $iaddress, $ial, $ialchan, $ibl, $idle, $iel, $ifmatch, $ifmatch2, $ignore, $iif, $iil, $inellipse, $ini, $initopic, $inmidi, $inmode, $inmp3, $inpaste, $inpoly, $input, $inrect, $inroundrect, $insong, $insongpause, $instok, $int, $intersect, $inwave, $inwho, $ip, $iptype, $iql, $isadmin, $isalias, $isbit, $isdde, $isdir, $isfile, $isid, $islower, $istok, $istokcs, $isupper, $isutf

K $keychar, $keyrpt, $keyval, $knick

L $lactive, $lactivecid, $lactivewid, $left, $leftwin, $leftwincid, $leftwinwid, $len, $level, $lf, $line, $lines, $link, $lock, $locked, $lof, $log, $log10, $logdir, $logstamp, $logstampfmt, $longfn, $longip, $lower, $ltimer

M $maddress, $mask, $matchkey, $matchtok, $matchtokcs, $maxlenl, $maxlenm, $maxlens, $md5, $me, $menu, $menubar, $menucontext, $menutype, $mid, $mididir, $mircdir, $mircexe, $mircini, $mkfn, $mklogfn, $mknickfn, $mnick, $mode, $modefirst, $modelast, $modespl, $mouse, $mousecx, $mousecy, $mousedx, $mousedy, $mousekey, $mouselb, $mousex, $mousey, $mousewin, $mp3, $mp3dir, $msfile, $msgstamp, $msgtags

N $N, $naddress, $network, $newnick, $nhnick, $nick, $nickmode, $no, $nofile, $nopath, $nopnick, $noqt, $not, $notags, $notify, $null, $numeric, $numtok, $nvnick

O $ok, $online, $onlineserver, $onlinetotal $onpoly, $opnick, $or, $ord, $os

P $parmN, $parms, $parseline, $parsetype, $parseutf, $passivedcc, $pi, $pic, $play, $pnick, $portable, $portfree, $pos, $poscs, $prefix, $prop, $protect, $puttok

Q $qt, $query

R $r, $raddress, $rand, $rands, $rawbytes, $rawmsg, $read, $readini, $readn, $regbr, $regerrstr, $regex, $regml, $regmlex, $regsub, $regsubex, $remote, $remove, $removecs, $remtok, $remtokcs, $replace, $replacecs, $replacex, $replacexcs, $reptok, $reptokcs, $result, $rgb, $right, $rnick, $round

S $samepath, $scid, $scon, $script, $scriptdir, $scriptline, $sdir, $send, $server, $serverip, $servertarget, $sfile, $sha1, $sha256, $sha384, $sha512, $shortfn, $show, $signal, $sin, $sinh, $site, $sline, $snick, $snicks, $snotify, $sock, $sockbr, $sockerr, $sockname, $sorttok, $sorttokcs, $sound, $speak, $sqrt, $sreq, $ssl, $sslcertsha1, $sslcertsha256, $sslcertvalid, $ssldll, $ssllibdll, $sslready, $sslversion, $starting, $status, $str, $strip, $stripped, $style, $submenu, $switchbar, $sysdir

T $tan, $tanh, $target, $tempfn, $ticks, $time, $timeout, $timer, $timestamp, $timestampfmt, $timezone, $tip, $tips, $titlebar, $token, $toolbar, $topic, $totp, $treebar, $true, $trust

U $ulevel, $ulist, $unsafe, $upper, $uptime, $url, $usermode, $utfdecode, $utfencode

V $v1, $v2, $var, $vc, $vcmd, $vcmdstat, $vcmdver, $version, $vnick, $vol

W $wavedir, $wid, $width, $wildsite, $wildtok, $wildtokcs, $window, $wrap

X $xor

Y $yes

Z $zip

= =$nick