Reading a file with new system.
HamletEagle told me using read_file is a bad idea and I tried using fopen instead. The only tutorial does not work for me and I am trying to read a file from end to start.
Can someone please show me a code of an example or really specific directions? |
Re: Reading a file with new system.
Why would you read the file from end to start? Give me a valid reason.
|
Re: Reading a file with new system.
Quote:
|
Re: Reading a file with new system.
Files can be read only forwards, not backwards. Better describe what exactly you are trying to do together with examples.
|
Re: Reading a file with new system.
Quote:
|
Re: Reading a file with new system.
Quote:
Code:
3 |
Re: Reading a file with new system.
Can't really help you unless you post a file that you're reading and the code that reads the mentioned file.
Also, ftell() doesn't return the line number. From http://www.cplusplus.com/reference/cstdio/ftell/: Quote:
|
Re: Reading a file with new system.
Now it works, I used a variable instead and it is probably better than natives.
PHP Code:
|
Re: Reading a file with new system.
Because they probably contain "\n" or "\n\r". Do trim() on the string. Also you can check if the string is empty by doing
PHP Code:
|
Re: Reading a file with new system.
Quote:
Note: Your check is equal to mine ( !Text[0] ), what helped was trim(Text); |
| All times are GMT -4. The time now is 23:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.