sublimetext-automatic-backups icon indicating copy to clipboard operation
sublimetext-automatic-backups copied to clipboard

FileNotFoundError: [WinError 206] The filename or extension is too long

Open ahudock opened this issue 5 years ago • 3 comments

I realize this is a Windows limitation and I'm not entirely sure how you might go about solving it, but I'm running into the 260 char file path limit when trying to save files with deep folder structures and/or long filenames.

Changing 'backup_dir' to something shorter is helpful, and I've read about registry tweaks and group policy changes to enable Win32 long paths, but perhaps there's a programmatic solution for working around the char limit?

Edit: missing word

ahudock avatar Nov 23 '19 21:11 ahudock

That is probably going to be outside the scope of this plugin.

I would suggest creating a NTFS junction that lets you reference into the long path, e.g. c:/my_backups targeting c:/my/very/long/.../path/backups

joelpt avatar Nov 26 '19 05:11 joelpt

Thanks for the advice, Joel, and thank you for this extension!

FYI, this is mainly happening because I'm trying to use sublimetext-automatic-backups in conjunction with the SFTP extension while editing remote files. The sites I work on already have fairly deep folder structures, then the SFTP extension creates an even deeper temp file. It's a fringe case but I at least wanted it to be on your radar.

ahudock avatar Nov 27 '19 03:11 ahudock

Wanted to leave this here for people like me who stumbled through the bushes into the comments. How to Enable Win32 Long Paths in Windows 11/10

arcticpinecone avatar Nov 28 '23 20:11 arcticpinecone