in reply to storing all file info

Hi, I am not sure I understand properly, but this should create two files, one with list of files, another with list of directories. I tried to keep your original code as intact as possible.
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
    Better, also, to check your opens.
    See perldoc -f die or Super Search for nodes where "open" and "test" both occur.
Re^2: storing all file info
by Baphi (Acolyte) on Dec 31, 2009 at 15:42 UTC

    thanks roman, and I apreciate that you kept my original code, it works great ... my problem was simply not knowing I would get hidden files I mistaken them for being in the rong directory :) thank you and happy newyears.