Import happens too fast!
Brought to you by:
baumgarr
If I save attachement from my (web) email to one of nixnote2 import folders, it is first written to disk with .crdownload -extension and then renamed to right one. So, if attacement is file.ext
it is saved first to file.ext.crdownload
and after that renamed to file.ext
.
When saving to disk start, nixnote2 will first create document file.ext.crdownload
with that partly saved file, try to delete it and then when file is ready nixnote2 creates second document with file.ext
and finally manage to remove that file.
What would be solution? Maybe if user could configure extensions what are not imported? Or system would wait that files "modified time" is at least 10 seconds old before it is imported (and deleted).
I did a quick workaround fix this in v2.1.0-beta3d - https://github.com/robert7/nixnote2/releases
Currently the ignored extensions are not configurable, but for now all file with ".tmp" in file name are ignored.
So you can create simple bash script could be used to copy files to import folder. Example:
I could make the extensions configurable, if this is still issue for someone.
more info also here: https://github.com/robert7/nixnote2/issues/14
Last edit: Robert Spiegel 2018-09-01
Hi!
Because problem is files saved with www browser, you cannot change extension of it (at least not easily)
For quick working fix would be:
Timer what check import directories every 10 seconds
If new file found from import directory
wait 5 seconds
try to import, if file dont' exists, jump out. Other case is import.
This would be working solution at every case.
Thank you!
Ok there is also easier workaround solution without the "sh" script I proposed before.
This works both with v2.0 and v2.1
Just organize your workflow as follows:
1, do the download to "Directory1" - e.g. ~/Downloads
2, then setup "Import folders" to a subdirectory of it - Directory2 - e.g. ~/Downloads/nixnote
3, then download your files...
4, when finished, move all files from Directory1 to Directory2 - as "move" is "atomic" operation, the problem should nort occur. Eg. mark all files in ~/Downloads then Cut & paste to the "Import folder" ~/Downloads/nixnote
Then important point is you must not do "Copy&Paste" but "Cut&Paste" (=move)..