Baphi has asked for the wisdom of the Perl Monks concerning the following question:
Hello, Im having trouble getting my C directory files and directories on seperate terms, from there I want to write the files from C into one text file for reference, and all the directories from C into another text file. this is what I have so far, it prints files but not the files from C, infact im not sure where theyr coming from :)Thank you.
opendir C, "C:\\"; @C_DIR = (readdir(C)); closedir C; open (Ctxt, ">full system memory\\C_DRIVE.txt"); foreach $C_FILE (@C_DIR) { if (-f "C:/$C_FILE") { print Ctxt "$C_FILE"; print Ctxt"\n"; } } close (Ctxt);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: storing all file info
by bobr (Monk) on Dec 31, 2009 at 15:36 UTC | |
by ww (Archbishop) on Dec 31, 2009 at 15:54 UTC | |
by Baphi (Acolyte) on Dec 31, 2009 at 15:42 UTC | |
|
Re: storing all file info
by ~~David~~ (Hermit) on Dec 31, 2009 at 15:33 UTC |