mIRC Home    About    Download    Register    News    Help

Print Thread
file kb,mg #217332 08/01/10 09:15 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Hello,

Has anyone anyidea how can i see for any file how much KB or MB or GB is the file, and when it has the last update? for e.g: an .mrc file


thanks

Re: file kb,mg [Re: westor] #217333 08/01/10 09:18 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Look at $file() and $bytes()


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: file kb,mg [Re: starbucks_mafia] #217335 08/01/10 09:22 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Yes i had a look and when i do it it return an number but what kind of number is , Kilobytes? or Bytes? , also when i use the .atime prop it return me a number how can i get the resault for e.g: 08/01/2010

e.g: alias test { echo -s is: $file($script).size }

Last edited by westor; 08/01/10 09:24 PM.
Re: file kb,mg [Re: westor] #217336 08/01/10 09:25 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$file().size returns the size in bytes. You can use $asctime() to convert $file().atime to a human-readable value.

Re: file kb,mg [Re: westor] #217337 08/01/10 09:27 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Well if you run it on $script - (ie. a small text file) and it returns a value in the hundreds or thousands range, logic should narrow it down fairly quickly. In fact, logic should narrow it down regardless.

Plus the second half of my post kind of gives it away.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: file kb,mg [Re: Collective] #217338 08/01/10 09:27 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
can you give me an example how can i convert from bytes to kilobytes? or the .mtime / .atime prop ?

Last edited by westor; 08/01/10 09:28 PM.
Re: file kb,mg [Re: westor] #217339 08/01/10 09:32 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$bytes($file($script).size).suf

$asctime($file($script).mtime)

Re: file kb,mg [Re: Collective] #217340 08/01/10 09:36 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Thanks