C-Command Software Forum

Shortening File Names

Apologies again for monopolizing the forum–I’m doing a lot of workflow rearranging. (And replies from people other than Michael are welcome!)

I’d planned to move my Eaglefiler library from Dropbox to OneDrive, but there’s a bug in Onedrive: If it hits a filename larger than 256 words it crashes and has to be re-installed. It identifies only the file that caused the immediate crash.

Is there a script or other way of shortening file names in an Eaglefiler library before attempting the OneNote installation?

What do you mean by “256 words”? The Mac file system only supports 255 characters.

Sorry, typo. 256 characters. The problem–which is all over the Windows help boards–is that OneDrive basically implodes when it hits a file name that large. It doesn’t just fail to sync but crashes and requires re-installation.

I don’t know if this conflicts with what the wikipedia article says, but I have some extraordinarily long file names in Eaglefiler–for example, Amazon websites converted to pdf that include long descriptions of the product. I have so many files that checking them manually would be arduous.

I don’t know if Dropbox is syncing these files or not, but it doesn’t crash (across Windows and Mac).

On a Mac, each file/folder name can be up to 255 characters. For OneDrive, I just found this page, which states that the entire path must be fewer than 255 characters:

The entire path, including the file name, must contain fewer than 255 characters. Shorten the name of your file or the name of subfolders in OneDrive, or select a subfolder that’s closer to the top-level folder.

So shortening the filenames by script would help—and I can look into writing a script—but you may need to adjust your folder hierarchy as well.

There are also some filenames that are not allowed:

Change its name so that it doesn’t begin or end with a space, end with a period, or include any of these characters: / \ < > : * " ? |

These names aren’t allowed for files or folders: AUX, PRN, NUL, CON, COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9

There are some similar issues with Dropbox for Windows, and there’s a script to adjust the filenames.

Yes, I already use that script! I should invest in learning Applescript, so I can do this stuff myself.

But it does seem like Onedrive should do something other than crash when it hits a problematic filepath. It makes me leery of Onedrive.

Agreed. Here’s a Shorten Path script that will try to rename files to get them under the OneDrive limit.

Wow, thanks. I look forward to trying it out. I think I’ve done enough wrestling with OneDrive for one week!

(I’d be curious to hear other people’s reactions to OneDrive. If I can get past this issue, the $100 yearly for Office 365 seems like a better deal than paying for Office AND DropBox. But DropBox has been flawless and fast.)

Unlike Dropbox, it looks like OneDrive does not support Mac file metadata.