Manipulate string in file
Is there a way to pull a line up without leaving a space? when using "^r" there is an "invisible space on the line.
Example: PHP Code:
|
Re: Manipulate string in file
Provide the sample output so I don't need to create a text file, compile your plugin, and test it myself.
Easiest may be just to set the last character to EOS. |
Re: Manipulate string in file
The result looks like the example below:
PHP Code:
So the text looks like this: PHP Code:
|
Re: Manipulate string in file
I am having no issue. Though, I am working on very little.. you have not said what exactly you are trying to do or what the source file contents look like. If you need help, provide the problem at hand, not your troubleshooting.
PHP Code:
Code:
Test line1PHP Code:
|
Re: Manipulate string in file
2 Attachment(s)
Quote:
Let's use the function below as a test to remove an admin for example, after finding the line with steamid I remove it ok? PHP Code:
|
Re: Manipulate string in file
I would change your approach. Create an entirely new temp file with lines that should be there and when done, delete the original and do a rename on the temp. Backup your users.ini beforehand.
PHP Code:
|
Re: Manipulate string in file
Calling it an "invisible" space is redundant because it's just the regular space character (0x20), what you get when you press your space bar.
When I use: PHP Code:
Code:
helloCode:
helloAlso, the fact that you're trying to edit a file with write_file() while that same file is open with fopen() is a problem in general (I'm not sure if AMX Mod X has any safe guards in place to prevent bad behavior when you do this). |
Re: Manipulate string in file
Our worst enemy is fatigue, taking into account all the help and even what was punctuated by the fysiks, we arrived at the code below which is apparently functional, thanks.
PHP Code:
|
Re: Manipulate string in file
Cool, pretty much the proper way to code what I provided.
|
Re: Manipulate string in file
Quote:
|
| All times are GMT -4. The time now is 14:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.