- Check for filename length of 244 instead of 254 to allow for some multibyte characters when checking storage sync error

- On Linux, if filename is over 130 characters and under 244, display filename in error message and include ecrypt suggestion
This commit is contained in:
Dan Stillman 2009-11-01 21:20:34 +00:00
parent a4f8e45b73
commit ec9b1bed37

View file

@ -933,10 +933,21 @@ Zotero.Sync.Storage = new function () {
if (e.name == "NS_ERROR_FILE_NOT_FOUND" && destFile.path.length > 255) {
windowsLength = true;
}
// ext3/ext4/HFS+ have a filename length limit of ~254 characters
else if (e.name == "NS_ERROR_FAILURE" && destFile.leafName.length >= 254) {
// ext3/ext4/HFS+ have a filename length limit of ~254 bytes
//
// These filenames will almost always be ASCII ad files,
// but allow an extra 10 bytes anyway
else if (e.name == "NS_ERROR_FAILURE" && destFile.leafName.length >= 244) {
nameLength = true;
}
// ecrypt (on Ubuntu, at least) can result in a lower limit --
// not much we can do about this, but log a warning
else if (e.name == "NS_ERROR_FAILURE" && Zotero.isLinux && destFile.leafName.length > 130) {
var msg = "Error creating file '" + destFile.leafName + "' "
+ "(Are you using filesystem encryption such as ecrypt "
+ "that results in a filename length limit below 255 bytes?)";
Components.utils.reportError(msg);
}
if (windowsLength || nameLength) {
// Is this the main attachment file?