reading line ( linux & windows line format )
Hello everyone!
here's my code: PHP Code:
what do i mean by linux&window line format: window's one: [IMG]http://s29.************/8wigyi987/window.png[/IMG] line: 13 10 or 0D0A ( 2 bytes ) linux's one: [IMG]http://s13.************/f4nkzitjr/linux.png[/IMG] line: 10 or 0A ( 1 byte ) for example loading windows lines in linux will cause fgets to get whole file, i assume that because while i was debugging the code, loop did only one cycle. I dont know how windows will react to linux lines, never tried it. Didn't find it that important i guess... Anyideas how to fix my problem here? Thanks! edit: one solution would be using fread i guess. Calling fread for every char but this is just too bad, i better code module and parse things there but i was hoping there's another way. |
Re: reading line ( linux & windows line format )
I don't understand what is your problem (all your said doesn't make much sense for me), but you should use "trim()" and not this silly "replace(temp2, 1023, "^n", "")".
|
Re: reading line ( linux & windows line format )
why not refer the AMXX source code?
|
Re: reading line ( linux & windows line format )
Quote:
You really never had this kind of problem? Also, can you point out of parts which confused you, i try to make things cleared. |
Re: reading line ( linux & windows line format )
Are you saying fgets fails to find \n under linux, if text file has \r\n as line end? This doesn't make much sense for me.
|
Re: reading line ( linux & windows line format )
Quote:
Maybe you should post more stuff. Attach your text file that is causing this behavior as well as your test plugin in which you've been able to reproduce the error. |
Re: reading line ( linux & windows line format )
Quote:
Then it was fine. |
| All times are GMT -4. The time now is 01:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.