No such thing as a small change | |
PerlMonks |
Re: Searching for a music filesby Marshall (Canon) |
on Aug 13, 2010 at 08:31 UTC ( [id://854855]=note: print w/replies, xml ) | Need Help?? |
I think we've got some fine suggestions in this thread. I was thinking about another problem that could rear its ugly head: how do you find the drives that you want to do complete searches upon? Windows drive letter assignments can move around for various reasons. So I hacked out this thing to get a listing of the drives on my system. You might find something like this helpful? I'm sure that there is some better / faster way to do this as this is slow, but it appears to work... Have fun if its helpful.. Update: As per testing from Ratazong, code works but you have to have admin rights to run fsutil. So I went searching for another way... I don't think that the "vol" command requires any special rights to run as it appears in the standard list of command when you type "help" at the command prompt. Using the ouput is a bit trickier because you have to use information from both STDERR and STDOUT but from that info you can glean the 3 possibilities (a) device exists but no media in it, (b) this is something that looks like a hard drive, (c) no device exists. Code shown below. Not quite as much info as the fsutil code, but probably close enough for most purposes.
In Section
Seekers of Perl Wisdom
|
|