Possible bug? Exporting file with child files creates two folders with same name in

I have a file named Images with 3 child files, one of which has an additional child file. These are outside of the Draft folder in my project. When I export the Images file with sub documents included it creates a folder named “Images” on my hard drive. Inside that folder are two more folders both named “Images”, one of which is empty and the other has the exported files. This is a violation of Windows folder structure—you can’t have two files or folders with the same name within the same folder in Windows. When I try to delete either files or folders I get the message "This folder does not exist on drive K:" and the files or folders are not deleted.

In Scrivener it reported that no files were exported even though the files were exported.

The only way I was able to delete the files and folders was using Secure Wipe in Directory Opus. After deleting the empty Images folder I was able to then access the Images folder that had the exported folder.

When I export a file that has only one level of child files the problem does not appear.

I don’t know if this indicates a corrupted project or a bug in Scrivener but I thought I should report it.

After exporting the files from my project I deleted them within the Scrivener project. That was about 2.5 weeks ago. I’ve never had any indications within Scrivener that there were problems with the project. I have multiple backups from each day I’ve worked on the project. This problem appears in the backups I’ve tested.

Any suggestions as to whether I should be worried about my project would be appreciated, and I’m happy to do any testing or share my project if that would be helpful.

I tried setting things up like this:

If I select “Images” in the binder and export, to a new folder called ‘export folder’, then I get this result:

└── Images
    ├── Images.rtf
    ├── one.png
    ├── two
    │   └── three.png
    └── two.png

I think that matches what you described? We can see here the bug with it exporting an .rtf file for the empty “Images” file group though, but it is at least coherent and not creating multiple items with the same name somehow.

Check to see if anything has spaces at the end of the file name in the binder. We do have a bug logged about that, where spaces can cause export malfunctions and lead to files you can’t delete in File Explorer. It sounds a lot like what you’re describing.

1 Like

Yes, that does match what I have. And one of the folders that was being duplicated did have a space at the end of the folder name (file name in Scrivener). When I deleted the space at the end it exported correctly.

There were a couple of folders that originally had this problem; I can’t say for certain whether they all had an extra space at the end of the filename, but this seems likely.

Thanks for the help—I’ll be careful about having extra spaces at the ends of filenames / folder names in Scrivener.

And for anyone encountering this or similar problem, the Secure Wipe feature in Directory Opus was able to delete the files and folders that Windows could not. (Directory Opus is a high power Windows Explorer replacement; the Secure Wipe feature overwrites the file and deletes it multiple times to make it completely unrecoverable, at least in theory …).

1 Like

Thanks for the confirmation! I’ll make sure the bug report ticket is marked accordingly. I think it was filed as low priority initially, but given how this creates a scenario where you have to use third-party tools to fix the file system, that’s not good at all.