5

I see that Win32API::File supports MoveFile(). However, I'm not sure how CORE::rename() is implemented in such a fashion that it should matter. Could someone juxtapose the difference -- specifically for the Win32 Environment -- between

  • CORE::rename()
  • File::Copy::move()
  • and, Win32API::File::MoveFile()
Denis Ibaev
  • 2,470
  • 23
  • 29
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468

1 Answers1

2

rename is implemented in a broken fashion since forever; move too, since it uses rename.

Win32::Unicode::File exposes MoveFileW from windows.h as moveW, and apparently handles encoding in a sane fashion, whereas Win32API::File leaves that to the user AFAICS from existing example code.

Related: How do I copy a file with a UTF-8 filename to another UTF-8 filename in Perl on Windows?

Community
  • 1
  • 1
daxim
  • 39,270
  • 4
  • 65
  • 132
  • so if you don't have UTF-8 in the filename does it make a different if you just use CORE::rename()? – Evan Carroll Jun 26 '12 at 19:49
  • Yeah, what's the chance of that? Unicode of course never occurs in file names, so we programmers can be as care-free as [rainbow farting unicorns](http://forgifs.com/gallery/d/201297-1/Unicorn-farts.gif). – daxim Jun 26 '12 at 20:03
  • Well.. In this specific case I'm moving `/store/{sha1}.{ext}` to `/bak/{sha1}.{ext}` in a qty of about 10 million, so don't assume that I don't know my own workload. There is 0 chance of Unicode being in the file name. – Evan Carroll Jun 26 '12 at 22:13