From WikiChip
Editing mirc/identifiers/$file

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|$file Identifier}}'''$file''' can be used in two ways:
+
{{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.
 
 
* '''$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, {{Deprecated feature|new={{mIRC|$sfile}}}}
 
  
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$file(filename).prop </pre>
+
<pre>$file(filename)[.property]</pre>
<pre>$file="title" dir</pre>
 
  
 
== Parameters ==
 
== Parameters ==
* '''filename''' - The filename or directory to any local or networked resource, optionally including absolute or relative path (relative to {{mIRC|$mircdir}})
+
<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]]).
* '''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 ==
 
== Properties ==
When new $file(filename) is used, you can use the following properties:
+
{| class="wikitable" style="margin-left: 75px;"
* '''.size''' - Returns the file's size in bytes. (default) (see: {{mIRC|$bytes}})
+
|-
* '''.ctime''' - Returns the file's creation time. (see: {{mIRC|$asctime}})
+
! Property !! Description
* '''.mtime''' - Returns the file's modification time. (see: {{mIRC|$asctime}})
+
|-
* '''.atime''' - Returns the file's last access time. (see: {{mIRC|$asctime}})
+
| '''.size''' || Returns the file's size in bytes. (default) (see: [[$bytes]])
* '''.shortfn''' - Returns the file's short filename (if it has one).
+
|-
* '''.longfn''' - Returns the file's long filename.
+
| '''.ctime''' || Returns the file's creation time. (see: [[$asctime]])
* '''.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.
+
| '''.mtime''' || Returns the file's modification time. (see: [[$asctime]])
** '''c''' - if file/folder is compressed.
+
|-
** '''d''' - if it is a directory.
+
| '''.atime''' || Returns the file's last access time. (see: [[$asctime]])
** '''e''' - if the file/folder is encrypted
+
|-
** '''h''' - if the file/folder is hidden.
+
| '''.shortfn''' || Returns the file's short filename (if it has one).
** '''n''' - if the file/folder is normal, not indexed.
+
|-
<!--- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-sparse --->
+
| '''.longfn''' || Returns the file's long filename.
** '''o''' - the file data is physically moved to offline storage (Remote Storage).
+
|-
** '''p''' - if the file is sparse.
+
| '''.attr''' || Returns the file's attributes.
** '''r''' - if the file/folder is in read only mode
+
|-
** '''s''' - if the file/folder is a system file/folder
+
| '''.sig''' || Checks digital signature of an executable/DLL file. (Returns: ok, fail, none)
** '''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
+
| '''.version''' || Returns the file's ''file version'' if executable/DLL.
** '''y''' - if the file is temporary
+
|-
* '''.sig''' - Checks digital signature of an executable/DLL file. (Returns: ok, fail, none)
+
| '''.product''' || Returns the file's ''product version'' if executable/DLL.
* '''.ext''' - Returns the extention of the filename if a filename is used, $null otherwise
+
|- style="vertical-align:top;"
* '''.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.
+
| '''.flags''' || Returns the file's ''file flags'' if executable/DLL, as explained below.
* '''.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
+
The value will be a combination bitmask that specifies the compile time attributes of the file.
* '''.version''' - Returns the file's ''file version'' if executable/DLL.
+
'''1: DEBUG''' - The file contains debugging information or is compiled with debugging features enabled.
* '''.product''' - Returns the file's ''product version'' if executable/DLL.
+
'''2: PRERELEASE''' - The file is a development version, not a commercially released product.
* '''.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:
+
'''4: PATCHED''' - The file has been modified and is not identical to the original shipping file of the same version number.
** '''1: DEBUG''' - The file contains debugging information or is compiled with debugging features enabled.
+
'''8: PRIVATEBUILD''' - The file was not built using standard release procedures.
** '''2: PRERELEASE''' - The file is a development version, not a commercially released product.
+
'''16: INFOINFERRED''' - The file's version structure was created dynamically; therefore, some of the members in this structure may be empty or incorrect.
** '''4: PATCHED''' - The file has been modified and is not identical to the original shipping file of the same version number.
+
'''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.
** '''8: PRIVATEBUILD''' - The file was not built using standard release procedures.
+
See: https://msdn.microsoft.com/en-us/library/windows/desktop/ms646997(v=vs.85).aspx
** '''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 ==
 
== Example ==
Line 64: Line 55:
  
 
== See Also ==
 
== See Also ==
 +
{{mIRC|File Handling}}
 
{{mIRC identifier list}}
 
{{mIRC identifier list}}
  
 
[[Category:mIRC identifiers|file]]
 
[[Category:mIRC identifiers|file]]

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)