in reply to Re^2: permission error
in thread permission error
The code you posted will open every file that exists and passes the -f (entry is plain file) file test.
Unfortunately, it will also open the same output file on each pass of the while loop -- with write permission (not append). Ie, every pass through the loop creates a completely new c:/move/output/test/out.txt file. I suspect this is the reason you believe you are only finding a single file.
To append to the file on each pass, change your open command from open OUT,">C:/move/output/test/out.txt"; to open OUT,">>C:/move/output/test/out.txt"; You should also consider checking the return value of open.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: permission error
by zzgulu (Novice) on Mar 02, 2010 at 14:02 UTC |