Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Perl, is there a difference between Win32API::File::MoveFile and CORE::rename on MSWin32?

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()
like image 895
NO WAR WITH RUSSIA Avatar asked Nov 04 '22 21:11

NO WAR WITH RUSSIA


1 Answers

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?

like image 59
daxim Avatar answered Nov 15 '22 05:11

daxim