I'd like someone to expand on the advantages of the following change
in 7.7:
> o Stdio
> The functions read_file(), read_bytes(), write_file() and
> append_file() now always throw errors upon errors, to allow easier
> use as errno doesn't have to be checked. read_file() and
> read_bytes() still returns 0 if the file does not exists.
Specificly for read_file() on files you lack permissions for.
> Stdio.read_file("/etc/shadow");
(1) Result: 0
vs
> Stdio.read_file("/etc/shadow");
Failed to open "/etc/shadow": Permission denied
/pkg/pike/intel-debian3_1/7.7.13/pike/7.7.13/lib/modules/Stdio.pmod/module.pmod:1820:
Stdio->read_file("/etc/shadow",UNDEFINED,UNDEFINED)
As I see it it only makes it harder to properly handle errors. If Pike
had a well developed system for handling errors it would be an
improvement, but now it's only going to lead to more and buggier code.
Unless someone can come up with a good explanation* for why it should
be changed it should be reverted.
* Like for example "I've extended and documented the error
classes. It's obvious and clear how to use them now!". That'd be nice.