Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: How do I copy an empty directory?

by kcott (Canon)
on Oct 02, 2012 at 21:15 UTC ( #996921=note: print w/replies, xml ) Need Help??

in reply to How do I copy an empty directory?

Have you tried File::Copy?

Your node title has "How do I copy ..."; your node content has "How can I move ...". File::Copy has functions for both operations.

Update: It appears I was wrong about the copy() part; although, move() seems to work fine. See discussion below.

-- Ken

Replies are listed 'Best First'.
Re^2: How do I copy an empty directory?
by Anonymous Monk on Oct 03, 2012 at 00:58 UTC
    Correct me if I am wrong, but File::Copy copies files and not directories.

      Well, it seems you're correct with respect to File::Copy::copy(); however, File::Copy::move() seems to work fine.

      I tried copy() on an empty directory and just got an empty (normal) file. I then tried move() on an empty directory and that worked; move() on a populated directory also worked, i.e. moved the directory and its contents.

      If you're the OP, sorry for the bum steer. I'll update my post.

      -- Ken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996921]
[perldigious]: That's awesome erix. One of my work friends, who coincidentally convinced me to learn Perl originally, has a Finnish pen-pal. I showed him this and he immediately wanted to send it along to her.
[perldigious]: Also coincidentally, I'm currently in the middle of a winter storm that has dropped 1 foot of snow and is expected to drop another. I might have to adapt this for customers/vendors who come visit and put it at the beggining of every presentation I give.
[Discipulus]: the photo was removed... Cyrano de Berjerac was not of the same idea..
[stevieb]: perldigious: video near our hq in Montreal. Here in Calgary, it's -28c... we've only got 3" of snow so far, but there are several feet in the mountains already

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2016-12-06 16:26 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (112 votes). Check out past polls.