rfc:fsync_function

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:fsync_function [2021/02/01 17:31] – add fdatasync to proposal dwgeblerrfc:fsync_function [2021/02/03 17:45] – correct typo dwgebler
Line 28: Line 28:
 bool(false) bool(false)
  
-$fp = fopen('file.txt', 'r'); +$fp = fopen('php://stdin', 'w');
-// Can't fsync / fdatasync read-only file, but it is a valid file handle, so we just return false with no warning.+
 var_dump(fsync($fp)); var_dump(fsync($fp));
 bool(false) bool(false)
 </code> </code>
 +
 +======== Sample documentation ========
 +
 +
 +fsync() - synchronize changes to a file
 +
 +fdatasync() - synchronize the data of a file
 +
 +fsync ( resource $stream ) : bool
 +
 +Request that all data for the open file pointer $stream is to be transferred to the storage device. The manner of synchronization is OS dependent. The fsync() function shall not return until the system has completed that action or until an error is detected.
 +
 +Returns true on success or false on failure.
 +
 +If the resource indicated by $stream is not a file pointer, an E_WARNING is emitted.
 +
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
rfc/fsync_function.txt · Last modified: 2021/04/13 14:10 by nikic