Re: URGENT! Regarding file writing

From: Date: Tue, 13 Feb 2001 23:27:02 +0000
Subject: Re: URGENT! Regarding file writing
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-39525@lists.php.net to get a copy of this message
Without knowing exactly what you're doing I'd say it's easiest to read the entire file into an array, modify the line you want, and write the file back out. Then you could easily modify any line you wanted. Otherwise check out fseek () in the PHP manual. whatever wrote:
How to do that? I mean how to set file pointer to certain line? I've tried ftel() but it returns starnge number like 17534 decrementing it causes file-handle error Yes i do have adequate permissions to modify the file in question on Win2000 10x in advance Nemanja NOTE: My email is incorrect. Please remove nospam part. On 13 Feb 2001 14:55:11 -0800, mmcglothlin@travel-italy.com (Michael McGlothlin) wrote:
Did you try taking the line you wanted to change and doing a minus one to get the right line number? Not sure why windows won't change the file. I'm assuming you have the proper permissions to do what your trying to do?


« previous php.general (#39525) next »