76_SolarForecast: contrib V 1.54.4
git-svn-id: https://svn.fhem.de/fhem/trunk@30139 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -5952,14 +5952,17 @@ sub __updWriteFile {
|
||||
open my $fh, '>:raw', $fPath or return "update ERROR open $fPath failed: $!";
|
||||
|
||||
my $bytes = encode ('UTF-8', $content);
|
||||
print {$fh} $bytes;
|
||||
my $written = syswrite $fh, $bytes;
|
||||
close $fh or return "update ERROR closing $fPath failed: $!";
|
||||
|
||||
my $written = -s $fPath;
|
||||
my $expected = strlength ($bytes);
|
||||
unless (defined $written) {
|
||||
return "update ERROR writing $fPath failed: $!";
|
||||
}
|
||||
|
||||
my $expected = length $bytes;
|
||||
|
||||
if ($written != $expected) {
|
||||
return "update ERROR writing $fPath failed: $!";
|
||||
return sprintf "update ERROR wrote %d of %d bytes to %s", $written, $expected, $fPath;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user