GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-May-2003, 16:12
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

file_get_contents()


OK, I have had ONLY good experiences with using :

string file_get_contents ( string filename [, int use_include_path])

but yesterday I thought up a script that would involve reading ( i.e. file_get_contents() ) and ALSO writing into the same file in some circumstances.

My question is, do I have to flock() the file when writing or would it not matter?
  #2  
Old 18-May-2003, 03:54
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
why should you want to use flock()

just use file_put_contents() to write to the file
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #3  
Old 18-May-2003, 04:00
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Is that available already??? I didn't bother to check on my server (PHP 4.3.1) - I thought it was CVS only...
  #4  
Old 18-May-2003, 04:17
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
I tried it at my box, it worked...
but I'm running a cvs version....

I checked with 4.3.2-RC2 but it's still not there..

sorry about that.

http://php.net/manual/en/function.file-put-contents.php
says what it does. just some normal file functions...
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #5  
Old 18-May-2003, 04:27
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Nope, it doesn't work for me either:

Code:
[Sun May 18 18:05:55 2003] [error] PHP Fatal error: Call to undefined function: file_put_contents() in c:\home\tests\public_html\fpc.php on line 14
 
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:12.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.