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