Get the Perl rename utility instead of the built-in rename [closed]

I can only speak for Debian. The two programs are called /usr/bin/rename.ul from the util-linux package (hence the .ul suffix) /usr/bin/prename from the perl package The actual rename command works via the /etc/alternatives mechanism, whereby /usr/bin/rename is a symlink to /etc/alternatives/rename /etc/alternatives/rename is a symlink to /usr/bin/prename The same problem has been bugging me on … Read more

Rename file in DocumentDirectory

To rename a file you can use NSFileManager’s moveItemAtURL. Moving the file with moveItemAtURL at the same location but with two different file names is the same operation as “renaming”. Simple example: Swift 2 do { let path = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] let documentDirectory = NSURL(fileURLWithPath: path) let originPath = documentDirectory.URLByAppendingPathComponent(“currentname.pdf”) let destinationPath = documentDirectory.URLByAppendingPathComponent(“newname.pdf”) … Read more

How do you change the capitalization of filenames in Git?

Starting Git 2.0.1 (June 25th, 2014), a git mv will just work on a case-insensitive OS. See commit baa37bf by David Turner (dturner-tw). mv: allow renaming to fix case on case-insensitive filesystems “git mv hello.txt Hello.txt” on a case-insensitive filesystem always triggers “destination already exists” error, because these two names refer to the same path … Read more

android, How to rename a file?

In your code: Shouldn’t it be : File from = new File(directory, currentFileName); instead of File from = new File(directory, “currentFileName”); For safety, Use the File.renameTo() . But check for directory existence before renaming it! File dir = Environment.getExternalStorageDirectory(); if(dir.exists()){ File from = new File(dir,”from.mp4″); File to = new File(dir,”to.mp4″); if(from.exists()) from.renameTo(to); } Refer: http://developer.android.com/reference/java/io/File.html#renameTo%28java.io.File%29

Is rename() atomic?

Yes and no. rename() is atomic assuming the OS does not crash. It cannot be split by any other filesystem op. If the system crashes you might see a ln() operation instead. Also note, when operating on a network filesystem, you might get ENOENT when the operation succeeded successfully. Local filesystem can’t do that to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)