[darcs-users] darcs patch: Spaces and punctuation in upload.cgi. (and 1 more)
Dmitry Kurochkin
dmitry.kurochkin at gmail.com
Sat Sep 13 05:12:45 UTC 2008
Thanks for review!
On Sat, Sep 13, 2008 at 4:07 AM, Nathan Gray <kolibrie at graystudios.org> wrote:
> On Fri, Sep 12, 2008 at 04:32:08PM -0700, Dmitry Kurochkin wrote:
>> I am not a good Perl coder, so it would be nice if someone reviews the changes.
>
> The only line that I'm not sure is okay is this one:
>
> until (link("$tmp_file", "$maildir/$base_name")) {
>
> The 'link' command makes hard links, which means if $tmp_file and
> $maildir are on different partitions the link will fail. In that case,
> you may want to fall back to 'symlink'.
>
> my $symlink_exists = eval { symlink("",""); 1 };
> until (link("$tmp_file", "$maildir/$base_name") or
> ($symlink_exists ? symlink("$tmp_file", "$maildir/$base_name") : 0)) {
I know that. Link was used in the previous version of upload.cgi. It is fast, so
I decided to leave it. And regarding different partitions, I put this comment:
> my $tmp_dir; # temporary directory, when placing patches to maildir
> # files are linked from $tmp_dir to $maildir
Symlink will not work here. Alternative is to use move. But I think
link is fine -
there is a comment, and besides link is only used for maildir functionality. I
expect that sendmail would be used more often.
Regards,
Dmitry
More information about the darcs-users
mailing list