mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-31 12:23:48 +01:00
error handling
This commit is contained in:
parent
12d3419989
commit
d1381371c4
@ -212,11 +212,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function file_write($path, $data) {
|
function file_write($path, $data) {
|
||||||
$fp = fopen($path, 'c');
|
if(!$fp = fopen($path, 'c'))
|
||||||
|
error('Unable to open file for writing: ' . $path);
|
||||||
|
|
||||||
// File locking
|
// File locking
|
||||||
if(!flock($fp, LOCK_EX)) {
|
if(!flock($fp, LOCK_EX)) {
|
||||||
error('Unable to lock file!');
|
error('Unable to lock file: ' . $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Truncate file
|
// Truncate file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user