On Tue, Nov 23, 2004 at 10:16:15AM +0100, Norbert Gruener wrote:

 > Here my questions:
 > 
 >  - where is this behavior activated ?
 > 
 >  - can I deactivate this behavior ?
 > 
 >  - and if so how can I deactivate it ?

 That's handled by IO::All (IO::All::File).  I was looking at the code,
 and I can't quite spot why the file is being unlinked before being
 written.  AFAICS the code eventually ends up in something like:

    open($file, $mode);

 and even if $file starts with ">" that means it will be truncated, but
 not unlinked.  There are no explicit calls to "unlink".  The
 interesting code is this (Spoon::ContentObject)

sub store_content {
    my $content = $self->content;
    if ($content) {
        $content =~ s/\r//g;
        $content =~ s/\n*\z/\n/;
    }
    my $file = io->file($self->file_path)->utf8;
    return if $file->exists and 
              $content eq $file->all;
    $file->print($content);
    return $self;
}

 That io->file ends up being IO::All::File::file, and after this I get
 lost :-P

-- 
Marcelo

Reply via email to