473,378 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

File::Find package

296 100+
File::Find traverses a network folder also.

If I give \\ipaddress\dir it works but not when \\ipaddress .

How to make it traverse all the shared folders of a machine by inputting the IPAddress only?
Nov 12 '09 #1
5 2690
I don't know, but isn't it possible to put the directories of \\ipaddress in a list and then do a find in that list?

But I don't know if this works (just starting with Perl):
Expand|Select|Wrap|Line Numbers
  1. my $homedir = "\\\\ipaddress";
  2. opendir (IMD, $homedir) or die "Couldn't find dir: IMD ($!)";
  3. my @thefiles= readdir(IMD);
  4. closedir(IMD);
Nov 12 '09 #2
RonB
589 Expert Mod 512MB
@pankajit09
You can't

A unc path is \\server(name or ip)\sharename\dir where dir is optional

Without the sharename the unc path is incomplete and can not be searched.
Nov 12 '09 #3
pankajit09
296 100+
@RonB

When I give the UNC path with only the IPADDRESS in the "run" box and press the enter button it shows all the shared folders.
Nov 13 '09 #4
pankajit09
296 100+
@ezechiel

No it doesn't work if we give only the IPADDRESS.
Nov 13 '09 #5
RonB
589 Expert Mod 512MB
@pankajit09
That's because the "run box" is a Windows application which, when given a partial unc path, "knows" that it needs to make calls to 1 or more dll functions that can get the list of share names.

Try doing it from the command line.
Example:
Expand|Select|Wrap|Line Numbers
  1. C:\>dir \\10.100.0.118
  2. The filename, directory name, or volume label syntax is incorrect.
  3.  
  4. C:\>dir \\10.100.0.118\c$
  5.  Volume in drive \\10.100.0.118\c$ has no label.
  6.  Volume Serial Number is 3019-C2D7
  7.  
  8.  Directory of \\10.100.0.118\c$
  9.  
  10. 02/11/2009  01:49 PM            18,791 021scan.txt
  11. 02/11/2009  10:20 AM            19,141 021scan.txt.bak
  12. ...
  13. ...
If you want, you could use Win32::API to call the dll functions that return the list of shares, however that's not as easy as you might think.
Nov 13 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ralph Freshour | last post by:
I looked in the manual and searched the web but did not see a file find function that takes a wild card - I need to look for all files such as: $Array = FileFind('name_*.jpg'); And then I...
6
by: micha | last post by:
suppose i have 3 files: script.php somedir/include.php somedir/config.php 1. script.php includes include.php 2. include.php includes config.php, so the structure looks like a cascade now...
3
by: Greg Yasko | last post by:
Hi. Does anyone know if there's an equivalent of Perl's file::find module in Python? It traverses a directory. I've googled extensively and checked this newsgroup and can't find anything like it...
1
by: Pierre-Yves | last post by:
Hello, I have to loop recursively in directories to build a tree. Based on the directory name, I know I can skip some (i.e: the BACKUP ones) to improve the performances that are currently very...
2
by: Arjen | last post by:
Hi, Can someone help me to update my XML file? This is what I have. XmlDoc.Load(MapPath("~/myFile.xml")); XmlNodeList oXmlUser = oXmlDoc.GetElementsByTagName("user"); foreach (XmlNode user...
5
by: booksnore | last post by:
I'm looking for a way to sort text files consisting of fixed file format. The files are big, typically over 10 million records and they consist of about 100 fields with the record being over 600...
2
by: juventusaurabh | last post by:
Hi all, I'm a rookie and would like to know how do I use the DTS package in my C# code. I actually want to input a pipe-delimited text file and convert it into SQL tables and also validate the...
1
by: juventusaurabh | last post by:
Hi, Has anyone managed executing a DTS package in SQL Server 2000 from a windows form created using c#? Also, I specify the path of the new file everytime through this windows form. Please...
2
by: minouparhizkar | last post by:
hi could anyone helping me to finish this i have no idea how to implement the program in java im trying to grabbing the pixel from image and then convert it to the txt file .i did that but it didnt...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.