Case changes not persisting on USB flash drive

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Case changes not persisting on USB flash drive

Postby AlatosTheBlue » Sun Jan 24, 2021 7:56 pm

I used Replace(3) to change the case of one or two words on a directory on a USB flash drive. 15 files were changed. If I refresh the file list, the 15 filenames revert back to their original name.

I copy the files to my hard drive, repeat the same Replace(3), and the changes persist if the list is refreshed.

I am using the latest version 3.4.1.0 on Windows 10 Home X64 Version 10.0.19042 Build 19042
AlatosTheBlue
 
Posts: 3
Joined: Sun Jan 24, 2021 7:39 pm

Re: Changes not persisting on USB flash drive

Postby Admin » Mon Jan 25, 2021 6:02 am

Hi, how is the USB drive formatted?
There seem to be some issues with Win 10 in this respect:
https://www.tenforums.com/general-support/110649-windows-10-filename-case-problem.html
Admin
Site Admin
 
Posts: 2059
Joined: Tue Mar 08, 2005 8:39 pm

Re: Case changes not persisting on USB flash drive

Postby AlatosTheBlue » Mon Jan 25, 2021 1:49 pm

FAT32 on a Micro Center SuperSpeed 256GB USB 3.0 Flash Drive.
AlatosTheBlue
 
Posts: 3
Joined: Sun Jan 24, 2021 7:39 pm

Re: Case changes not persisting on USB flash drive

Postby AlatosTheBlue » Mon Jan 25, 2021 1:55 pm

I tried BRU on the flash drive changing the case of the file name and adding an additional character to effectively change the name. Once I removed the added character, the case change persisted.
AlatosTheBlue
 
Posts: 3
Joined: Sun Jan 24, 2021 7:39 pm

Re: Case changes not persisting on USB flash drive

Postby Opositive » Mon Jan 25, 2021 2:34 pm

As noted above, the format used on the drive is critical to this discussion.

Most USB flash drives sold today are formatted as either FAT32 or exFAT. Both of these file systems are case insensitive/case preserving. The Windows OS will represent the files to you with the same mixed-case filename that they were originally stored with (case preserving) but the OS actually stores and handles filenames in a way that doesn't care about the case (case insensitive).

Because of this simply changing the case of a filename on any FAT-formatted drive (FAT, FAT16, FAT32, exFAT) will do absolutely nothing. Changes that result in two filenames that differ only by case will not be recorded by the filesystem. In order to make the case changes stick you have to make some other change to the filename (e.g. adding or deleting characters) along with the case changes and then go back and undo the additional change. This forces the OS to rewrite the filename and preserve the altered case.

For instance, if you want to change "randomfile.txt" to "RandomFile.txt" you first need to change it to something like "ARandomFile.txt" and then change it again to "RandomFile.txt". This is easily done with BRU but it's a pain no matter how you look at it. It's not BRU's fault, though. It's due to the limitation of the file system.

Other filesystems like NTFS store the filename in a fundamentally different way from the FAT-based systems and can be used in a case-sensitive manner. Formatting a flash drive with NTFS, though, is generally not a great a idea for a number of reasons. There are times when you want to do it but see any of the voluminous discussions about it on the net to understand the pros and cons before you do.

Note that the OS also plays a role in all this. Windows effectively comes out-of-the-box case insensitive/case preserving regardless of what file system is used on a drive. This is due to a Windows "feature" called "prettying the path". This behavior can be changed, however, using the "DontPrettyPath" key in the registry. How that's done is beyond the scope of this forum. Just Google "DontPrettyPath" and you'll get all the info you want. Just be warned that changing that key can cause unexpected behavior when renaming files on network shares. Caution is advised.

So you just need to do a two-step dance to get it working. It's usually the best you can you given the limits of the filesystem and OS you're working with.

Good luck with it.

Opos.
Opositive
 
Posts: 2
Joined: Sat Jan 23, 2021 10:35 am


Return to BRU Support