Couple code questions

Stéphane Alnet stephane at shimaore.net
Sat May 23 19:54:43 UTC 2009


I've been getting some unexpected errors using brackup and wanted to
get the list's opinions or feedback on them:

- Inconsistent filesizes during backup: Brackup::Root::encrypt()
checks the filesize after writing the temporary file to the disk, and
I've been getting errors at that point in the code semi-regularly (but
I can't reproduce the issue). I was thinking that maybe a "binmode
$tmpfh" was missing (this would make no sense since I'm running
MacOSX), or maybe that "syswrite $tmpfh, $$data" should be used
instead of "print $tmpfh $$data" (again, this makes little sense, but
my understanding of the differences is limited to what transpires from
"man perlfunc").

- Another hypothesis would be that the different brackup processes end
up using the same temporary filename; I'm regularly getting errors
from gpg about files that do not exist, or directories (in /tmp) that
do not exist. Does anyone have any insight on these? (I could modify
Brackup::Util::tempfile() to add a PID as part of the filename, I
imagine.)

- Unrelated: I've noticed that there are encryption (gpg) calls in at
least three different places, and that some use --batch, others
--yes... Reading gpg's documentation it seems that --batch should be
the consistent choice, and that --yes would then make little sense
(since there would be no interaction).

Stéphane


More information about the brackup mailing list