in reply to Re^2: differences in dir?
in thread differences in dir?
Hmm. I tried it (on XP), and I get exactly the same output, including data and time, in the file as I get to the screen:
[0] Perl> `dir >junk.txt`;; [0] Perl> @d2 = do{ local @ARGV = 'junk.txt'; <> };; [0] Perl> print for @d2[ 0 .. 10 ];; Volume in drive C has no label. Volume Serial Number is BCCA-B4CC Directory of c:\test 2007-05-02 16:31 <DIR> . 2007-05-02 16:31 <DIR> .. 2005-06-24 13:45 721 12balls.pl 2005-11-12 16:16 1,142 12days-enc.pl 2005-11-13 02:26 1,688 12days.pl 2004-07-28 00:37 124,592,128 1Mx4096.db
As far as I am aware, the only way to get a raw list of files without the data and time is to use the /b switch on the dir command:
[0] Perl> `dir /b >junk.txt`;; [0] Perl> @d2 = do{ local @ARGV = 'junk.txt'; <> };; [0] Perl> print for @d2[ 0 .. 10 ];; 12balls.pl 12days-enc.pl 12days.pl 1Mx4096.db 2.log 200083.pl 216398.pl 250802.pl 275606.pl 27x2.wav 282393.pl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: differences in dir? (dir.exe)
by tye (Sage) on May 02, 2007 at 17:22 UTC | |
by BrowserUk (Patriarch) on May 02, 2007 at 17:36 UTC |