Sheik
13th June 2008, 15:04
Hi all,
I have a question/comment about FileRead.
I have a file of data that is NOT binary data, but I do NOT want to parse it on a line by line basis either, but instead grab chunks of the file at various offsets as needed.
The problem is that FileRead will read up to a CRLF, and then return with that set of data regardless of the value of [maxlen] that I provide to the FileRead command.
What I am looking for is for FileRead to have an option to simply ignore CRLF, and just return up to [maxlen] data that I provide to the command, OR, if the file is at EOF, return whatever data there is up until EOF.
So what I have done as a patch, is change FileRead to allow for negative values in [maxlen].
If a negative value is passed in, we mark a flag to tell it to NOT quit reading after finding a CRLF, but instead to keep going until maxlen is reached, or we run into the end of the file.
This patch works well, and I would like to submit it, to hopefully be taken.
However, I am thinking instead of overriding the functionality of FileRead, maybe I should make a new command?
Thoughts? Suggestions?
Scott
I have a question/comment about FileRead.
I have a file of data that is NOT binary data, but I do NOT want to parse it on a line by line basis either, but instead grab chunks of the file at various offsets as needed.
The problem is that FileRead will read up to a CRLF, and then return with that set of data regardless of the value of [maxlen] that I provide to the FileRead command.
What I am looking for is for FileRead to have an option to simply ignore CRLF, and just return up to [maxlen] data that I provide to the command, OR, if the file is at EOF, return whatever data there is up until EOF.
So what I have done as a patch, is change FileRead to allow for negative values in [maxlen].
If a negative value is passed in, we mark a flag to tell it to NOT quit reading after finding a CRLF, but instead to keep going until maxlen is reached, or we run into the end of the file.
This patch works well, and I would like to submit it, to hopefully be taken.
However, I am thinking instead of overriding the functionality of FileRead, maybe I should make a new command?
Thoughts? Suggestions?
Scott