[okular] [Bug 402017] Cannot save PDF when loaded file has been deleted

Pino Toscano bugzilla_noreply at kde.org
Thu May 14 08:09:54 BST 2020


https://bugs.kde.org/show_bug.cgi?id=402017

--- Comment #16 from Pino Toscano <pino at kde.org> ---
(In reply to David Hurka from comment #13)
> @Pino: Can you tell more about the problem? Can it be fixed, or do we need
> another approach than creating a file handle?

See bug 163363.

Holding an open descriptor on the document fixes the case that the document
disappears (hello firefox, and apparently hello kmail too...) while it is
opened in okular.

The big downside, which is also what I mentioned, is that file watching breaks,
and reading the commit should give an hint on why: the handle is kept for the
_old_ file, so when some PDF producer (latex, etc) creates a new file by
rename()ing the new temporary file on the old name (which is an atomic
operation), you don't notice that.
At least, I remember there were problems in the results you get from file
watching because of this.

While fixing firefox to not remove files under applications' feet is not an
easy task (12 years and still no change on that), why don't we fix at least our
own products (kmail)?

Enabling FileKeeper again will not fix this situation, as you will trade one
issue with another.

(In reply to Nate Graham from comment #14)
> Temporarily wasting some memory or disk space is a far better alternative
> than data loss. :)

This won't behave nicely in editing sessions e.g. in kile or in other document
producers, where you edit the sources and save+recompile to PDF often,
resulting in a big churn of file creations/removals, and in slowdown due to the
blocking file saving.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list