[pve-devel] [PATCH pve-zsync 02/11] Avoid 'no such file' error when no state exists.

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Sep 28 11:40:03 CEST 2015


---
 pve-zsync | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pve-zsync b/pve-zsync
index 216057b..9de01d2 100644
--- a/pve-zsync
+++ b/pve-zsync
@@ -6,6 +6,7 @@ use Data::Dumper qw(Dumper);
 use Fcntl qw(:flock SEEK_END);
 use Getopt::Long qw(GetOptionsFromArray);
 use File::Copy qw(move);
+use File::Path qw(make_path);
 use Switch;
 use JSON;
 use IO::File;
@@ -244,6 +245,7 @@ sub param_to_job {
 sub read_state {
 
     if (!-e $STATE) {
+	make_path $CONFIG_PATH;
 	my $new_fh = IO::File->new("> $STATE");
 	die "Could not create $STATE: $!\n" if !$new_fh;
 	print $new_fh "{}";
-- 
2.1.4




More information about the pve-devel mailing list