lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does LilyPond delete the PDF first?


From: Reinhold Kainhofer
Subject: Re: Why does LilyPond delete the PDF first?
Date: Wed, 11 Jun 2008 14:51:35 +0200
User-agent: KMail/1.9.9

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Mittwoch, 11. Juni 2008 schrieb Valentin Villenave:
> 2008/6/11 Risto Vääräniemi <address@hidden>:
> > With this modification Ghostscript tries to open the file but cannot
> > because it's locked. I got a lot of programming errors saying: Parsed
> > object should be dead: static scm_unused_struct*.
>
> This is the kind of errors you get when you try to recompile a .ly
> file without closing the PDF reader.
>
> This locking thing is really annoying.
>
> > I guess Windows (and Acrobat) handles files differently than Linux and
> > KPDF. Could you test on Linux what happens, if a pdf is opened with
> > Acrobat (Reader) and you re-compile the file?
>
> I have the same behavior with Foxit Reader, Sumatra, and the JPedal
> viewer. So it's definitely an MS-Windows limitation.

Yes, in Linux you can compile a lilypond file while you have the PDF open in 
several applications (actually, I usually have several old versions of the 
same pdf open in kpdf at the same time, because kpdf doesn't detect a changed 
pdf and reload it. Of course, I mostly forget to close the PDF viewer, but 
that's no problem in Linux...)

Isn't there any platform-independent way to check whether an existing PDf file 
can be opened for writing?

Google turned up a list of file-related scheme commands (), maybe 
      (file-writeable? filename)
does what we need... Does this return #f for locked PDFs, too, or does it only 
look at file permissions? If it returns #f, that would probably the way to 
properly implement this (i.e. if the file is locked or write-protected, spit 
out an error message or try to delete the file, otherwise simply overwrite 
the file). If it only checks file permissions, maybe (file-open filename "a") 
will trigger an error and can be used to detect a locked file...


BTW, I get the same errors if I change the .ps file to read-only...

Cheers,
Reinhold

- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFIT8pYTqjEwhXvPN0RAnNLAJ9GXdqibvgZ2u7gemual7qFh4IHCQCgqCQT
FmcbFwSTXQs284gNBn5XWGE=
=af0c
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]