Tell me, please, is there any synchronization of the execution of PHP instructions with the computer operation in real time? In other words, is there any guarantee that after executing unlink(name)
instruction file_exists(name)
will give FALSE
?
- If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky ♦
|
1 answer
Your question has nothing to do with PHP. And he has to api operating system. Poetmoe will be closer to the gland. If there are two unlink(name)
and file_exists(name)
lines within a single thread and the file is file_exists
successfully, then yes, file_exists
return FALSE
. If the functions are called in different threads (different scripts) and it seems to you (for example logs) that the order is observed, then the result file_exists(name)
can be any - the file system takes some time to update the data and this time may well be a few seconds on loaded systems. And that's fine.
|