in reply to storing all file info
opendir C, "C:\\"; @C_DIR = (readdir(C)); closedir C; open(Ctxt_files, ">full system memory\\C_DRIVE_FILES.txt"); open(Ctxt_dirs, ">full system memory\\C_DRIVE_DIRS.txt"); foreach $C_FILE (@C_DIR) { if (-f "C:/$C_FILE") { print Ctxt_files "$C_FILE\n"; } elsif( -d "C:/$C_FILE") { print Ctxt_dirs "$C_FILE\n"; } } close(Ctxt_files); close(Ctxt_dirs);
Note it also lists hidden files.
-- hope this helps, Roman
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: storing all file info
by ww (Archbishop) on Dec 31, 2009 at 15:54 UTC | |
|
Re^2: storing all file info
by Baphi (Acolyte) on Dec 31, 2009 at 15:42 UTC |