1 package MooseX::Storage::Engine::IO::AtomicFile;
6 extends 'MooseX::Storage::Engine::IO::File';
9 my ($self, $data) = @_;
10 my $fh = IO::AtomicFile->new($self->file, 'w')
11 || confess "Unable to open file (" . $self->file . ") for storing : $!";
12 $fh->binmode(':utf8') if utf8::is_utf8($data);
15 || confess "Could not write atomic file (" . $self->file . ") because: $!";
26 MooseX::Storage::Engine::IO::AtomicFile - The actually atomic file storage mechanism.
30 This provides the actual means to store data to a file atomically.
40 =item B<store ($data)>
54 All complex software has bugs lurking in it, and this module is no
55 exception. If you find a bug please either email me, or add the bug
60 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
62 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
64 =head1 COPYRIGHT AND LICENSE
66 Copyright 2007-2008 by Infinity Interactive, Inc.
68 L<http://www.iinteractive.com>
70 This library is free software; you can redistribute it and/or modify
71 it under the same terms as Perl itself.