mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2005
Posts: 41
S
swgiant Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2005
Posts: 41
My current working PC contains hundred of words, excels and powerpoint files so i would like to play around with it...

To create a small database for doc, xls and ppt
Code:
create {
  hmake file 10000 | noop $findfile(c:\,*.doc,0,hadd file $calc($hget(file,0).item + 1) $1-)
noop $findfile(c:\,*.xls,0,hadd file $calc($hget(file,0).item + 1) $1-)
noop $findfile(c:\,*.ppt,0,hadd file $calc($hget(file,0).item + 1) $1-)
  echo -a Total amount of files added: $hget(file,0).item
}


i would like to search any file size greater than 30KB
Code:
searchsize { 
  .window -l @size | var %d 1 | while (%d <= $hget(file,0).item) { 
    if ($file($hget(file,%d)) >= 30720) { .aline @size $hget(file,%d) }
    inc %d
  }
}

Now i would like to sort with ctime, mtime and atime and file types but how... i stuck here...
Code:
sortctime {
  .window -les @ctime | var %q 1 
  while (%q <= $hget(file,0).item) { aline @ctime $file($hget(file,%q)).ctime | inc %q }
....
..........
}

The @ctime is numeric sorted but then how to sort the files in the hash table and present in @window? I stuck there...

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Originally Posted By: swgiant
My current working PC contains hundred of words, excels and powerpoint files so i would like to play around with it...

To create a small database for doc, xls and ppt
Code:
create {
  hmake file 10000 | noop $findfile(c:\,*.doc,0,hadd file $calc($hget(file,0).item + 1) $1-)
noop $findfile(c:\,*.xls,0,hadd file $calc($hget(file,0).item + 1) $1-)
noop $findfile(c:\,*.ppt,0,hadd file $calc($hget(file,0).item + 1) $1-)
  echo -a Total amount of files added: $hget(file,0).item
}


i would like to search any file size greater than 30KB
Code:
searchsize { 
  .window -l @size | var %d 1 | while (%d <= $hget(file,0).item) { 
    if ($file($hget(file,%d)) >= 30720) { .aline @size $hget(file,%d) }
    inc %d
  }
}

Now i would like to sort with ctime, mtime and atime and file types but how... i stuck here...
Code:
sortctime {
  .window -les @ctime | var %q 1 
  while (%q <= $hget(file,0).item) { aline @ctime $file($hget(file,%q)).ctime | inc %q }
....
..........
}

The @ctime is numeric sorted but then how to sort the files in the hash table and present in @window? I stuck there...



Here's a cheap shot at it...

Code:
sortctime {
  .window -les @tempctime | var %q 1
  while (%q <= $hget(file,0).item) { aline @tempctime $file($hget(file,%q)).ctime $hget(file,%q) | inc %q }
  .window -le @ctime | var %s 1
  while (%s <= $line(@tempctime,0)) { aline @ctime $gettok($line(@tempctime,%s),2-,32) | inc %s }
.close -@ @tempctime
}


This sorts @ctime in order, with the actual items in place, now its your choice here how to write it to the hash table, maybe clear the table and write the data from @ctime to the table? Remeber $line(@window,0) returns total of lines then you can loop it in the hash table

no?


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Jan 2005
Posts: 41
S
swgiant Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2005
Posts: 41
ok, thanks for the code and suggestion. now iam able to sort c/m/atime and sorting the file size by using /filter -tuww @ @

Last edited by swgiant; 03/10/07 05:30 AM.

Link Copied to Clipboard