X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/90f0e0b497ad75866cb8d15dd1a593f31ffbc6f7..a91cbf40e63f09f6e0177f08b0c83e554a0ea0f1:/SL/File/Backend/Webdav.pm?ds=sidebyside diff --git a/SL/File/Backend/Webdav.pm b/SL/File/Backend/Webdav.pm index b1e48edf9..2956e03f9 100644 --- a/SL/File/Backend/Webdav.pm +++ b/SL/File/Backend/Webdav.pm @@ -5,12 +5,13 @@ use strict; use parent qw(SL::File::Backend); use SL::DB::File; -#use SL::Webdav; +use SL::System::Process; use File::Copy; use File::Slurp; use File::Basename; use File::Path qw(make_path); use File::MimeInfo::Magic; +use File::stat; # # public methods @@ -74,8 +75,7 @@ sub get_mtime { $main::lxdebug->message(LXDebug->DEBUG2(), "version=" .$params{version}); my ($path, undef, undef) = $self->webdav_path($params{dbfile}); die "No file found in Backend: " . $path unless -f $path; - my @st = stat($path); - my $dt = DateTime->from_epoch(epoch => $st[9])->clone(); + my $dt = DateTime->from_epoch(epoch => stat($path)->mtime, time_zone => $::locale->get_local_time_zone()->name)->clone(); $main::lxdebug->message(LXDebug->DEBUG2(), "dt=" .$dt); return $dt; } @@ -205,17 +205,7 @@ sub webdav_path { return (File::Spec->catfile($path, $fname), $path, $fname); } -sub get_rootdir { - my ($self) = @_; - - #TODO immer noch das alte Problem: - #je nachdem von woher der Aufruf kommt ist man in ./users oder . - my $rootdir = POSIX::getcwd(); - my $basename = basename($rootdir); - my $dirname = dirname($rootdir); - $rootdir = $dirname if $basename eq 'users'; - return $rootdir; -} +sub get_rootdir { SL::System::Process::exe_dir() } sub _get_number_from_model { my ($self, $dbfile) = @_; @@ -345,5 +335,3 @@ The synchronization must be tested and a periodical task is needed to synchroniz Martin Helmling Emartin.helmling@opendynamic.deE =cut - -