read_file ( const file[], line, text[], len, &txtLen )
read_file ( const file[], line, text[], len, &txtLen )
What is &txtLen here ? If i am not wrong file = file name Line = line number text= where the read line will be sotred len = length of text But I am not getting what is &txtLen |
Re: read_file ( const file[], line, text[], len, &txtLen )
len is the max size of the buffer you are willing to use to store the line.
txtLen is the length of the line read. |
Re: read_file ( const file[], line, text[], len, &txtLen )
okie ...
so what i will do if i want to read the 1st line of a file ? Will I do like new s_Buffer[256] read_file ( FILE_NAME, 0, s_Buffer, sizeof( s_Buffer-1), 255 ) Will it do ? |
Re: read_file ( const file[], line, text[], len, &txtLen )
last parameter tells u the length of the text you read from that line, so you should do this
new len; read_file ( FILE_NAME, 0, s_Buffer, sizeof( s_Buffer-1), len ) |
Re: read_file ( const file[], line, text[], len, &txtLen )
Using fopen(), fgets(), fclose(), etc are more better if you are going to read more than one line.
|
Re: read_file ( const file[], line, text[], len, &txtLen )
I need to read one line only and then delete it and write some new line there :)
|
Re: read_file ( const file[], line, text[], len, &txtLen )
What criteria do you use to determine if a line will be replaced? Text contained in the line?
|
Re: read_file ( const file[], line, text[], len, &txtLen )
na ok lemme explain what i need ...
1) I wanna put one filename to a file say last.bat 2) It will only hold one file name . Next time i delete that line and put some other file name . So basically i will read / delete / write the 1st line . So what is the best way to do it ? |
Re: read_file ( const file[], line, text[], len, &txtLen )
PHP Code:
PHP Code:
|
Re: read_file ( const file[], line, text[], len, &txtLen )
Thanks a lot ... i will try it :)
One more thing if the file does not exits then how to wirte that file and make the first entry ? for example Code:
if(!file_exists(file)) |
| All times are GMT -4. The time now is 03:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.