thunders has asked for the wisdom of the Perl Monks concerning the following question:
I build a lot of tools that list of computers on my network(I'm on WINNT,as are most of the PC's I'm checking). Recently I've put together some tools to check if specific files or directories are present in a computer.
I've been able to do this with varing degrees of success by escaping to the shell and issuing commands like
my @query =`dir \\\\$cpu\\C\$\\path_to_specific_directory`
for every possible directory that could contain the folder I'm looking for. Then using grep and split on @query to find files I'm looking for.
This is very messy and un-perlish
What I would like to do is: given a known root directory (i.e. "\\$cpu\C$", remote C:\ drives). recursively search for a directory called "SomeApp\" (this shouldn't be more than two or three levels deep), and report the sub-directories one level below "SomeApp\". Is this a job for File::Find, the docs for that module didn't give any examples that seemed to apply to a problem like this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I search for a specific directory on a remote PC?
by dmmiller2k (Chaplain) on Jan 04, 2002 at 23:48 UTC | |
by Anonymous Monk on Jan 05, 2002 at 00:22 UTC | |
by Anonymous Monk on Jan 05, 2002 at 00:40 UTC | |
by thunders (Priest) on Jan 05, 2002 at 00:00 UTC | |
|
Re: How do I search for a specific directory on a remote PC?
by particle (Vicar) on Jan 05, 2002 at 00:16 UTC | |
by Anonymous Monk on Jan 07, 2002 at 09:30 UTC | |
by blakem (Monsignor) on Jan 07, 2002 at 12:40 UTC |