Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: permission error

by jrsimmon (Hermit)
on Mar 01, 2010 at 22:22 UTC ( [id://826020]=note: print w/replies, xml ) Need Help??


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
    Thank You!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://826020]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2025-02-07 14:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (94 votes). Check out past polls.