$fileinfo & $findfileinfo: 37 types of info
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 7.8 |
| Scores Submitted | 5 |
| Date Added | Jan 04, 2006 |
| Last Updated | Jan 04, 2006 |
| Tags | audio com |
|
|
Introduction
Author: FiberOPtics -- mirc.fiberoptics@gmail.com
Usage:
1)
$fileinfo(filepath, properties [,separator])[.raw]
Will retrieve information about a file. The possible properties are listed further below.
2)
$findfileinfo( initialize, properties [, seperator])[.raw]
$findfileinfo(<filepath>)
$findfileinfo(quit)
Findfileinfo is specifically designed to be used when you want to retrieve properties about files from a large collection. For example if you want to retrieve audio properties from your audio folder, which may contain hundreds or thousands of file, then $findfileinfo will be better suited than fileinfo.
You first initialize findfileinfo by specifying as first parameter the word "initialize" and as second parameters the properties that you will retrieve from each file in the collection. Once you are done with retrieving the info, you can use "initialize" again to set new properties or you can quit by specifying the keyword "quit". Let's make an example:
$findfileinfo(initialize, Artist Title Genre Duration Bitrate Audiosamplerate)
!.echo -q $findfile(d:\my audio\,*,0,aline @info $findfileinfo($1-))
$findfileinfo(quit)
3)
/listtags
This alias will list all available properties that you can use on your system. These properties will be in the language of your OS, but you must always use the English properties that you see right under this.
Properties:
Audio/video: Title Artist Author AlbumTitle Year TrackNumber Genre Duration BitRate Audiosamplesize Audiosamplerate Channels Protected Copyright EpisodeName Comments
Pictures: CameraModel DatePictureTaken Dimensions
Executables: ProgramDescription Company Description FileVersion ProductName ProductVersio
Misc: Attributes Status Owner Subject Category Pages
Common: Name Size Type DateModified DateCreated DateAccessed
Purpose: Returns up to 37 characteristics of any file. For example version information of .exe files, audio information of .wma/.mp3 files, etc. This uses Windows to retrieve the properties, which are the same when you right click a column label in Windows Explorer to specify which attributes from a file you want to see as default.
Info:
- Filepath must be the complete filepath, even when the file resides in the mIRC folder.
- Empty values for categories are filled with a zero.
- If you specify a third parameter, this will be used as a separator between the attributes. The default is a line feed $lf, which you can parse with $gettok(...,N,10) or //tokenize 10 $fileinfo(...)
- There are two ways of outputting the result.
(1) Default : "Propertyname: value <separator> ..."
(2) Raw : "value <seperator> ..."
The .raw property was added to give scripters more freedom in deciding the format of output.
Installment: The snippets go into the remote section because of their alias prefix. Alt+r -> tab "Remote" -> Paste there. You can also put it in the aliases section, provided you remove the alias prefix.
Requirements:
$fileinfo and $findfileinfo: mIRC 5.91, Windows ME or higher
/listtags: mIRC 6.14, all OS'es
Notes:
The info on executables is only available on XP+SP2. As for the rest, most of them should be available on the OS'es specified in the requirements.
Improperly tagged files, will obviously return improper info. Meaning if e.g. the albumtitle attribute wasn't filled in the audiofile, then the snippet will not be able to retrieve it evidently.
Examples:
$fileinfo(d:\audio\song.wma,Artist Title Genre Duration Bitrate Audiosamplerate,**)
$fileinfo($mircexe,Company Productname Productversion Fileversion Type Name)
$fileinfo(c:\pics\mypic.jpg,Dimensions Datepicturetaken,-=-).raw
mIRC Snippet:
$fileinfo & $findfileinfo: 37 types of info
Posted on Jan 4, 2006 8:29 pm
Posted on Jan 4, 2006 8:29 pm
Just curious about the audio file portion.. I know mirc doesnt support Id3v2 tags.... would this? And would you have to specify anything to on which tag to read?
mIRC Snippet:
$fileinfo & $findfileinfo: 37 types of info
Posted on Jan 4, 2006 8:33 pm
Posted on Jan 4, 2006 8:33 pm
It supports id3v2 if your Windows Explorer supports it. On my comp it does.
There's no option to specify what kind of tags to read in Windows as far as I know.
There's no option to specify what kind of tags to read in Windows as far as I know.
mIRC Snippet:
$fileinfo & $findfileinfo: 37 types of info
Posted on Jan 4, 2006 8:35 pm
Posted on Jan 4, 2006 8:35 pm
The primary reason that I made this was to read information about .wma files btw, something mIRC doesn't support. All the other properties were just a nice extra :)
mIRC Snippet:
$fileinfo & $findfileinfo: 37 types of info
Posted on Jan 4, 2006 9:15 pm
Posted on Jan 4, 2006 9:15 pm
You're an amazing coder, FiberOPtics. Glad that you decided to join us here at hawkee. :)
mIRC Snippet:
$fileinfo & $findfileinfo: 37 types of info
Posted on Jan 4, 2006 9:23 pm
Posted on Jan 4, 2006 9:23 pm
Thank you tank59, I appreciate your comment.
I've got a lot more snippets to submit, all of which provide something unique in mIRC that you won't find with "regular" scripting.
I've got a lot more snippets to submit, all of which provide something unique in mIRC that you won't find with "regular" scripting.
mIRC Snippet:
$fileinfo & $findfileinfo: 37 types of info
Posted on Jan 7, 2006 5:47 pm
Posted on Jan 7, 2006 5:47 pm
I agree with Tank. I havent seen anything that you've posted (here or at mircscripts.org) that isnt amazing.




