Modify a file using another file
Hello,
I made that plugin which gets the names from a file 'file1.ini' and check if they are on another file 'file2.ini', and if the second argument in the line which the name is found (on file2) is 0 then delete that line in the file1. But, it didn't work! Can someone see where is the problem? PHP Code:
|
Re: Modify a file using another file
I'm not sure if that's the only issue, but according to your description, the "option" part should be in file2. However, you try to get it from file1, so:
PHP Code:
PHP Code:
|
Re: Modify a file using another file
Quote:
|
Re: Modify a file using another file
any help ?
|
Re: Modify a file using another file
just put debug line//console print// per line, and see to where your code is 'executed' ?
|
Re: Modify a file using another file
You need to scan the files and write to a new file if your condition is met; once done, you then delete file1 and rename the new file to the file1 filename. With your code you are adding lines to the existing file.
I've always had issues with delete_file() failing. Can anyone weigh in on what the problem is? The tmpFile.tmp file is accurate regarding contents, but the deletion of the old file1 and renaming of temp to file1 fails. PHP Code:
|
Re: Modify a file using another file
Quote:
|
Re: Modify a file using another file
Quote:
|
All times are GMT -4. The time now is 02:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.