Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Opening a Directory

by wog (Curate)
on Jan 19, 2002 at 01:55 UTC ( #139964=note: print w/ replies, xml ) Need Help??


in reply to Opening a Directory

If the directory name has a space in between, what should I do?

If you call out to a shell command using the name of the direcotry use quotes or, better, the multi-argument form of system or exec (update: oops, open doesn't have which accepts an arbitrary number of arugments. If you want to not have spaces or quotes be an issue and to capture the output of or send input to a command use open and exec's multi-argument form.) Otherwise, perl's internal functions (rmdir, mkdir, chmod, etc.) and any modules shouldn't have a problem.

And how to capture all the files under a directory?

I'd reccommend File::Find, since that'll do the recursion necessary (into subdirectories, etc.). (But you can use opendir, readdir, and closedir directly, if you really want to.)


Comment on Re: Opening a Directory

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2014-10-20 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (92 votes), past polls