mIRC Home    About    Download    Register    News    Help

Print Thread
#181457 24/07/07 12:37 AM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
I've been working on a custom identifier to display information on the recycle bin, I've only tested it on XP so I can't confirm if it works on 9x, NT, ME, 2K, 2003, or Vista. Basically without changing the code too much unless it doesn't work on the above Operating Systems is there anything else I can do with it?

//echo -a $recycle(0) - Displays the number of files in the recycle bin.

//echo -a $recycle(0).size - Adds together the sizes of each file in the recycle bin.

//echo -a $recycle(1) - Displays the path and file of the first item in the recycle bin.

//echo -a $recycle(1).size - Displays the size of the first item in the recycle bin.

Properties: nopath, size, ctime, mtime, atime, shortfn, longfn, and attr.

Code:
alias recycle {
  if ($isid) {
    var %x = $findfile(C:\Recycler,*.*,0),%y = $findfile(C:\Recycler,*.*,$1), %z = C:\Recycler
    if (!$prop) {
      if ($1 == 0) return %x
      if ($1 != 0) && ($1 <= %x) return %y
    }
    elseif ($prop == nopath) {
      if ($1 <= %x) return $iif($nopath(%y) !isnum,$nopath(%y))
    }
    elseif ($prop == size) {
      if ($1 == 0) {
        noop $findfile(%z,*.*,0,var %size = $calc(%size + $file($1-)))
        return %size
      }
      if ($1 != 0) && ($1 <= %x) return $file(%y)
    }
    elseif ($prop == atime) { return $file(%y).atime }
    elseif ($prop == ctime) { return $file(%y).ctime }
    elseif ($prop == mtime) { return $file(%y).mtime }
    elseif ($prop == attr) { return $file(%y).attr }
    elseif ($prop == shortfn) { return $file(%y).shortfn }
    elseif ($prop == longfn) { return $file(%y).longfn }
  }
}


Thanks in advance!

SladeKraven

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
I just tried your code on my Windows 95, Windows 98 and ME systems (don't have systems with pure Windows versions for the others), and it worked flawlessly.

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Ah right, my main concern was the C:\Recycler folder if it differed to earlier Windows versions, I read somewhere that it did. Thanks. smile

Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
It seems that it is not the older versions that you need to worry about. I ran your code on Vista Ultimate x64, and it did not retrieve the items located in my recycle bin. When I look at my c:\ with system files NOT hidden, the recycle bin folder is listed as $recycle.bin . Within that folder is a folder with restricted permissions (I can't open it) with a strange folder name.

The other issue I noticed is that you assumed the operating system is located on the c:. However, this is not necessarily the case as Windows can be installed on any drive letter. Related to this issue is that each drive contains its own recycle bin folder that contains files deleted from that specific drive.

-genius_at_work

L
LostShadow
LostShadow
L
I don't have a C:\Recycler... I'm on XP, and I don't seem to have a path for Recycle Bin, except Recycle Bin..

#181463 24/07/07 03:42 AM
S
schaefer31
schaefer31
S
That's because it is a hidden system folder. If you go to Tools -> Folder Options -> View and then uncheck the box to show system files and folders, you will see it.

#181464 24/07/07 03:59 AM
L
LostShadow
LostShadow
L
Yea I got that that, I can view all the hidden files in the folder. On the contrary, I don't have any hidden files in RecycleBin.

The path just says Recycle Bin.

I also have "Display the full path in the address bar" All it says is Recycle Bin though.

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Hmm... No offence but have you actually looked at what your identifier returns? It doesn't return the files the user has deleted in any recognisable form. Windows stores files in the Recycle Bin in a different way to regular folders. See this MSDN article for how it works.

Also, I haven't tested it but by all rights this should not work on Win9x. It's not OS-based actually, it's filesystem based. FAT volumes use <Drive>:\Recycled, NTFS volumes use <Drive>:\Recycler.


Link Copied to Clipboard