Export error due to exceeded file path length.

Scrivener 3.1.1 on Windows 7 (64-Bit)

A few days ago, I tried to export my complete Scrivener Project as RTF files to back them up in my cloud, because the cryptic file names created by the program in the backup folder no longer allow any conclusion about the content of the individual files.

I have now noticed that during the export not all files were included. I traced this back to the fact that the character length allowed in Windows (259) was exceeded within my project’s directory structure. It goes unnoticed when using the program.

The corresponding key in the registry to be made HKEY_LOCAL_MACHINE Filesystem function is set to LongPathsEnabled with 1.

Nevertheless, the export does not seem to work when the files exceed the File Path restriction. There was no feedback in the form of an error message from the program that would have identified the failure during the export process. (Future feature?)

How can I still manage a complete export?

I am not sure I fully understand how your issue can be, but:

If you rather use the sync folder feature, you should be able to export all of your documents to RTF files.
Those files should keep their name/title, but without getting longer than they actually are. (I mean causing your issue.)
You can have them prefixed with a number, corresponding to their binder order.
(It’s actually quite the same as exporting the files yourself… but perhaps it’ll work better for you. (?))

One thing that I don’t quite get about the reason you’d want to backup like that though, is that, despite the fact that yes, it is hard to know which file is what inside a project folder, having Scrivener to “decode” that for you when presenting the project as its binder, why not simply backup the project (zipped and timestamped) like everyone else ?

Backup functions: Section B.9 (Page 693) of the manual.

1 Like

why not simply backup the project (zipped and timestamped) like everyone else?

I do (among other methods).

I want to use the export feature to continue working with individual text files on my mobile device. I currently have Scrivener running on relatively old hardware with an aged Windows 7 operating system. There are signs that the computer won’t make it much longer, so I need to find ways to continue working on my project on a new platform (Android) and without Scrivener. For this, I need to know which files I am dealing with. The zip file created by backup does not meet this requirement even when unzipped.

I see.
Then I think you should give the sync folder a try.
image

Or compile your files to RTF.

Then I think you should use the sync folder.
Or compile your files to RTF.

Thanks for the tip.

The sync folder sounds good! I will try that first. Compiling to RTF sounds interesting too. I will check up on that if syncing won’t work for some reason.

If the sync folder solution works, I would advise that you then move the files you so just created elsewhere, out of that folder.
So that the sync folder is empty.

The reason being that this is not what it is intended for, and that there is a risk that Scrivener could update your project with this folder’s content, later in the future, if you modified it.
Not something you’d want in this case.
You could potentially lose future work done on your project in Scrivener.

That unless, of course, you end up using the sync feature to sync with your Android device as it is intended.
I never do it, I just don’t like it/trust it (the cloud sync part, that is), so I can’t really help with the how to of that.
But done properly, you could probably use your computer until it dies on you. Losing then only whatever work you did since you last synced your project.
(To be read between the lines : sync often, should you do so.)

Note that this is not a real backup method, and that it shouldn’t replace properly doing so.
(Should you have had a spare computer on which to run Scrivener, I would have suggested something quite different.)

1 Like

@AmberV @tiho_d
I just noticed that this popup refers to MacOs in the Windows version.
Scrivener 3.1.2 Windows version :

image

Not sure if the feature/popup should be absent from the Windows version altogether, or if it should rather say “computer”, but it makes no sense from a Windows user’s point of view.

This has occasionally happened to me too in windows when backing up a file within the backup exceeds the file legnth allowed. Not sure how to search for this.

It is a constraint on the rules of the cloud location and perhaps how Windows handles these things. Frankly do not know for sure.

But easily(?) avoiding by excluding the scrivener project folder from the backup to the cloud location and instead rely on a) using the Scrivener automatics zip backups being sent to the cloud server and b) routine local full backups of the computer. For b) as I no longer use Windows so have no recommendation…for Mac readers of this, use Apple’s Timemachine at least.

For a) the zip file internalises all the long file names into one compressed file with a short name.

Hi, Eisen,
I’m sorry, I don’t have a solution for you, just maybe a cause.
The limit of 256 characters can be increased to 512. It involves modifying the Registry. Not sure that’s worth it, but I’m sure you can find it on the 'net if you want… I haven’t worked in Windows for more years than I want to admit but I do remember that Windows considers the path name to the file as part of the file name, so if your file is buried too deep in directory after directory, 256 characters isn’t hard to exceed.
Again, sorry, I have no answer. I’m sure the forum members will find on for you, though.
Good luck.

Thanks for all suggestions so far.

My feedback for those who are following the topic and are wondering which approach I have chosen so far for the problem I described at the beginning, or which one has led to a satisfactory result:

Following Vincent_Vincent’s advice, I first tried Scrivener’s Sync function.

The program created two subdirectories in the folder I predefined (ScrivSync):

  1. Draft
  2. Notes

Scrivener does not create any other subdirectories. Probably to keep the structure as flat as possible. Otherwise, files with very long names would not find a place due to the character limitation of the Windows system. This is already the first disadvantage of this method. The usual subdirectory structure within the program is removed. Any hierarchy is lost.

A workaround is a possibility to instruct the Sync function to prepend a number to each generated RTF file. These numbers are then assigned to each entry in the directory tree. Example:

Folder A

Folder B

Textfile C

The result in the draft folder looks like this:

1 Folder A [0]
2 Folder B [1]
3 Textfile C [2]

If you do not use the option of numbering, the numbers in front will not be added by function. The result, in this case, is an alphabetical order of the synced RTF files as opposed to a numbered one. Both have advantages and disadvantages.

The same applies to the Notes folder. The Sync function ignores any correlation between the RTF files in the Draft Folder and the corresponding Notes. Therefore, it might be difficult to establish the affiliation of Notes to the text files in the Draft Folder if the file numbers are not unambiguous.

Considering that the action of syncing could or should actually be intended to ensure collaboration between desktop and mobile apps (Yes, I know, there is no app yet. It may come, though, one day), or to ensure collaboration in a group, this procedure is not optimal in my opinion. Exchange with other programs (e.g. Obsidian) should also prove difficult with this.

The only advantage seems to be that at least all created texts are available as RTF. The HTML pages, PDF files, and images stored or linked in my research folder are in any case not available. Thus, these files are not part of the sync process. This is another reason why I wouldn’t call this function anything more than an emergency solution if the goal is merely to enable access from other applications to the documents within Scrivener.

Next, I will deal with the second compilation method recommended by Vincent_Vincent. As far as I can see from the manual, this method seems to allow the directory structure to be written into the respective headers of each generated RTF file. The hierarchy would be at least traceable by this method in this case.

I am familiar with this approach. I have checked my registry entries for this purpose.

“0” remains at 259-character length.
“1” extends the “LongPathsEnabled” setting in the HKEY_LOCAL_MACHINE filesystem function to a supposedly longer string.

This setting apparently has no effect on Scrivener’s export function. At least not on a Windows 7 OS.

You should keep in mind that this function is not intended to be used in the context you are trying to use it. That is just not what it is for.

The sync folder is intended to sync a project between Scrivener instances.
It does give you access to the files so that you can modify them in a third party app, then have Scrivener keep your project up to date, but by no means to sync the project as a whole with that said third party app. (At least, not to my knowledge.)

To be blunt, you are somewhat veering off course as regard to your issue being that your computer is dying, that you don’t have for a plan to replace it, and that you don’t intend to use Scrivener no more past this point.

Having your files numbered by the sync function, to the contrary of what you said hierarchy is preserved.
You may not have levels of the files preserved, but they are in the order they were in your Scrivener project’s binder.
Since you don’t intend to come back to the original Scrivener project, just fix the levels/hierarchy once in whatever other app you’ll use (or in File Explorer) and that’s it.

Initially, the point was to allow you to export all of your files (a workaround), and I believe you got that, now, right?

1 Like

If by all the files you mean the ones I created through Scrivener by the process of writing, then my intention was indeed fulfilled by means of the Sync function. Thanks! Yet by all files, as was my intention stated in my first post, I would count in all other entries made into my research folder as well. Those have not been synced. Besides that, this function is not the same as the export of files. I would rather describe it as a rudimentary extraction, really.

But I do accept the limitations given. It’s all a matter of workaround anyway these days.

Sure. Which is not in itself an issue, since it is not designed to do so in the first place.

Now, your problem was with the files you actually created in Scrivener, where some wouldn’t export.
We fixed that – good.

As for your other files, use the real export function. :wink:
image
Have the Research folder selected in the binder, export its content.

As for files that are linked to but don’t reside in the project’s folder, you’ll probably have to (if any) go fetch them by hand.