Am 13/06/2023 um 07:27 schrieb Dietmar Maurer:
>> One could argue that the case for not existent should return undef,
>> while an empty file should return an empty string, but for that we
>> might want to check all use-sites first.
> 
> AFAIR I use this function many times assuming that it does not throw errors 
> in case of empty files. That is quite convenient.

Yes, and it still doesn't errors in that case. Above is talking about 
differentiating
the not-existing, empty file and empty first-line cases.

Currently (and before my patch) the behavior is:

- file does not exist -> undef
- file exists but empty -> undef
- file exists but first line empty -> ''

It would be a bit more expected to have the "file exists but empty" case also 
return
an empty string, but it probably doesn't matter.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to