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:
DS_Starter
2025-07-20 17:20:09 +00:00
parent 1bbaa259c6
commit 10d8071f1c

View File

@@ -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;