I'm a novice with perl so take it easy on me. I'm trying to open a http directory on our network. What command do I use to open a http directory and read all the directories below it? The opendir command does not read http directories.
Our IS department has moved all our documentation that we need for on-call to SharePoint so I can't just copy and paste anymore for a standard directory on the network. Urrggh.
Here is a simple sample of code that I have written (this isn't complete)...
#Open the directory
opendir (DIR, "http://yoda/Documents/PSG/Customers/") || die ("Unable
+to open directory");
#Read list of files in the directory
while ($filename = readdir(DIR)) {
@files = readdir(DIR);
}
closedir(DIR);
#Remove the file . which represents the current directory
shift (@files);
#Go through each of the files in the directory
foreach $file (@files) {
#Open subfolder
open (DIR, "http://yoda/Documents/PSG/Customers/$file/Support/sitema
+p/")
#code here copies each document from subfolder to c:\sitemaps
}
Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.