This is a discussion on file_put_contents flags within the alt.comp.lang.php forums, part of the PHP Programming Forums category; The documentation for "file_put_contents" contains this: file_put_contents ( string filename, mixed data [, int flags [, resource context]] ) and this: flags ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
The documentation for "file_put_contents" contains this:
file_put_contents ( string filename, mixed data [, int flags [, resource context]] ) and this: flags can take FILE_USE_INCLUDE_PATH, FILE_APPEND and/or LOCK_EX What isn't clear is how FILE_APPEND and LOCK_EX are used together. This works: file_put_contents($name,$data,FILE_APPEND); but this doesn't: file_put_contents($name,$data,FILE_APPEND LOCK_EX); and this doesn't: file_put_contents($name,$data,FILE_APPEND, LOCK_EX); What am I doing wrong? I can find no examples that use both. Thanks in advance. |
|
|||
|
"McKirahan" <News@McKirahan.com> wrote in message
news:XqadnRAu4eJWPwnYnZ2dnUVZ_rGinZ2d@comcast.com. .. > The documentation for "file_put_contents" contains this: > file_put_contents ( string filename, mixed data [, int flags [, resource > context]] ) > and this: > flags can take FILE_USE_INCLUDE_PATH, FILE_APPEND and/or LOCK_EX > > What isn't clear is how FILE_APPEND and LOCK_EX are used together. > > This works: > file_put_contents($name,$data,FILE_APPEND); > but this doesn't: > file_put_contents($name,$data,FILE_APPEND LOCK_EX); > and this doesn't: > file_put_contents($name,$data,FILE_APPEND, LOCK_EX); Nevermind! file_put_contents($name,$data,FILE_APPEND+LOCK_EX) ; |
|
|||
|
McKirahan wrote: > The documentation for "file_put_contents" contains this: > file_put_contents ( string filename, mixed data [, int flags [, resource > context]] ) > and this: > flags can take FILE_USE_INCLUDE_PATH, FILE_APPEND and/or LOCK_EX > > What isn't clear is how FILE_APPEND and LOCK_EX are used together. > > This works: > file_put_contents($name,$data,FILE_APPEND); > but this doesn't: > file_put_contents($name,$data,FILE_APPEND LOCK_EX); > and this doesn't: > file_put_contents($name,$data,FILE_APPEND, LOCK_EX); > > What am I doing wrong? I can find no examples that use both. > > Thanks in advance. Just a thought, try file_put_contents($name,$data,FILE_APPEND | LOCK_EX); |