backup-bear-notes icon indicating copy to clipboard operation
backup-bear-notes copied to clipboard

Titles that are too long to become filenames are not truncated

Open mattdanielmurphy opened this issue 4 years ago • 4 comments

mattdanielmurphy avatar Dec 01 '20 22:12 mattdanielmurphy

What file system did you run into this in? What happens when a filename is too long for the file system?

TehShrike avatar Dec 01 '20 23:12 TehShrike

APFS. On a Mac running Big Sur.

/Users/matthewmurphy/.config/yarn/global/node_modules/backup-bear-notes/index.js:23
		throw err
		^

[Error: ENAMETOOLONG: name too long, open '/Users/matthewmurphy/Library/Mobile Documents/com~apple~CloudDocs/backup-test/this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long ti.md'] {
  errno: -63,
  code: 'ENAMETOOLONG',
  syscall: 'open',
  path: '/Users/matthewmurphy/Library/Mobile Documents/com~apple~CloudDocs/backup-test/this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long title this is a really long ti.md'
}

mattdanielmurphy avatar Dec 01 '20 23:12 mattdanielmurphy

Issue persists with a more reasonably short directory path (/Users/matthewmurphy/test/)

mattdanielmurphy avatar Dec 02 '20 00:12 mattdanielmurphy

If anyone can figure out the max file name length on Apple file systems, I'm open to any PRs that would trim filenames down to that length

TehShrike avatar Dec 07 '20 22:12 TehShrike