Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Seeking help for copying recursive folders having some folder/file names in Chinese or japanese

by BrowserUk (Patriarch)
on Jan 19, 2015 at 11:33 UTC ( [id://1113739]=note: print w/replies, xml ) Need Help??


in reply to Seeking help for copying recursive folders having some folder/file names in Chinese or japanese

Seeing the short-pathname A95B~1 produced in your example, I assume you are on windows. In which case try Win32::Unicode::cptreeW($from, $to)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
  • Comment on Re: Seeking help for copying recursive folders having some folder/file names in Chinese or japanese
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Seeking help for copying recursive folders having some folder/file names in Chinese or japanese
by aksjain (Acolyte) on Jan 19, 2015 at 15:23 UTC

    thanks for your response. Win32::Unicode::cptreeW works perfect in terms of copying the folder, but it do have an optimization for not copying the empty folders.

    Is there a way to get rid of this optimization? I just need to have the exact same directory structure at destination as it is on source location.

      but it do have an optimization for not copying the empty folders.

      It's not an optimisation as such; rather, just a side-effect of processing the tree the 'unix way'. Directories only get created if they do not exist when a file is to be copied into them.

      There is no architected API mechanism for changing this behaviour; nor can I see any easy way it could be retro-fitted or monkey patched to do so.

      My alternative would be to simply shell out to xcopy: system qq[ xcopy /E/I/C/O srcpath\\* destpath\\ ];.

      (You also might want to consider /G /H /R & /U. (See the help.))

      As it's supplied with the OS, it will be able to copy any files or directories that you've already created. It is also significantly quicker on deep trees.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (8)
As of 2024-04-24 10:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found