Possible duplicate:How to check if a PHP stream resource is writable or writable?
Does PHP provide any function for checking the mode of access to a file descriptor? Suppose I opened a file in read-only mode.
$file_handle = fopen('putty.log','r');
Is it possible to check the specific mode of access to the descriptor in the code?
Possible solution for search mode:
Use stream_get_meta_data function:
$file_handle = fopen('putty.log','r'); $metadata = stream_get_meta_data($file_handle); echo $metadata['mode'];
Read more about the returned array in the manual.
Source: https://habr.com/ru/post/1387921/More articles:How to install applet on smart card using java - javaGoogle App Engine module: missing required argument module [s] '- google-app-engineTextWatcher afterTextChanged calls stackoverflow in android - androidspeed limit algorithm suggestions for this scenario - javaCan I use jQuery pjax with backbone.js - jqueryMagento Reports - Products - Products Ordered Problem: Product (Mage_Catalog_Model_Product) with the same identifier already exists - magentoHow to implement HTTP transfer of huge binary files from a file generator to a server (Java)? - javaIs * ++ * p an acceptable syntax? - cahah in drupal doesn't work at all - drupalautomatic notification in database change: similar to facebook friend request - javascriptAll Articles