How to get errno file system on Linux

I see that the file_put_contents function returns FALSE , but is it possible to recognize the error ( errno ) returned from a system call from the Linux kernel?

There could be many reasons for failure (which may even be device or driver dependent). Therefore, I want to know the exact cause of the error.

file_put_contents simply returns FALSE on error.

What I want will be equivalent to C errno or perror C.

+4
source share
1 answer

The results may be mixed, but the closest equivalent to errno in PHP is error_get_last .

+3
source

All Articles