uce/site/doc/pages/file_get_contents.txt
2026-06-16 12:21:31 +00:00

20 lines
635 B
Plaintext

:sig
String file_get_contents(String file_name)
:params
file_name : file name of file that should be read
return value : String containing the file's contents
:see
>sys
:content
Reads the file identified by `file_name` and returns it as a `String`.
The read transparently takes a shared file lock for the duration of the call. If another worker is writing the same file with `file_put_contents()` or `file_append()`, this read waits for that exclusive write lock to finish, so callers do not manage locks manually.
If the file cannot be read, this function returns an empty string.
:example
print("file_get_contents example\n");