From WikiChip
Editing mirc/identifiers/$zip
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 28: | Line 28: | ||
== Properties == | == Properties == | ||
* '''.size''' - used with '''l''' only, makes $zip returns the size of the file (or 0 for a folder) instead of the filename | * '''.size''' - used with '''l''' only, makes $zip returns the size of the file (or 0 for a folder) instead of the filename | ||
− | * '''.mtime''' - used with '''l''' only, makes $zip returns the timestamp of the file instead of the filename | + | * '''.mtime''' - used with '''l''' only, makes $zip returns the timestamp of the file instead of the filename |
− | |||
− | |||
If '''l''' is not used, $zip returns 1 for success and 0 for failure. | If '''l''' is not used, $zip returns 1 for success and 0 for failure. | ||
Line 36: | Line 34: | ||
'''Note''': If .zip contains a potentially dangerous filename such as containing '../' then 'e' and 'l' return 0 and refuse to extract or list contents. | '''Note''': If .zip contains a potentially dangerous filename such as containing '../' then 'e' and 'l' return 0 and refuse to extract or list contents. | ||
− | '''Warning''': Using the 'o' switch when extracting should NOT be used when extracting into $mircdir or any folder having important files in that folder or in any subfolders below it, especially if the zip was not created by YOU | + | '''Warning''': Using the 'o' switch when extracting should NOT be used when extracting into $mircdir or any folder having important files in that folder or in any subfolders below it, especially if the zip was not created by YOU. |
== Example == | == Example == | ||
Line 81: | Line 79: | ||
Note: If the password is missing/wrong for a file inside the zip, any foldernames in the zip are created. | Note: If the password is missing/wrong for a file inside the zip, any foldernames in the zip are created. | ||
− | Create logs.zip containing contents of logs subfolder beneath $mircdir, returns 1 if successful | + | Create logs.zip containing contents of logs subfolder beneath $mircdir, returns 1 if successful |
− | |||
//echo -a $zip(logs.zip,c,logs) | //echo -a $zip(logs.zip,c,logs) | ||
− | |||
<source lang="mIRC"> | <source lang="mIRC"> | ||
− | |||
− | |||
List contents of logs.zip: | List contents of logs.zip: | ||
− | //var %i 1 | while ($zip(logs.zip,l,%i)) { echo -a $ord(%i) item: | + | //var %i 1 | while ($zip(logs.zip,l,%i)) { echo -a $ord(%i) item: $v1 | inc %i } |
Note that the 1st item was the name of the folder, indicated by the trailing backslash | Note that the 1st item was the name of the folder, indicated by the trailing backslash | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compatibility == | == Compatibility == |