Delphi textfile size limitation?

Hi, is there any file size limitation on reading a file of type "textfile" (using Readln and/or/Read) ? Can the file on disk be any size at all?

Thanks
    Shawn

P.S: I use Delphi 7
shawn857Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lopemCommented:
I think the limitation comes from the quantity of RAM you have available. I am guessing how Delphi manages components like the "memo" one. I think the implementation is dynamic, so you may feel the data space of a memo component cannot be filled with ascii characters, but in fact, all depends on the memory available to the program.

regards
Lopem (Manuel Lopez)
0
shawn857Author Commented:
Thanks Manual, but I'm not trying to read the whole file into memory at once. Just read one record, process it, read the next one, process it, etc.

Thanks
   Shawn
0
lopemCommented:
Ok, Shawn, how big is your record?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

shawn857Author Commented:
It could be almost any size Manuel... variable size. Could be very small or could be very big.

Thanks
   Shawn
0
mlmccCommented:
That is the problem.  When you do a readln it wants to read an entire line which could be too large for the buffer or the memo datatype.  It isn't a limit on file size but a limit on ne length.

mlmcc
0
shawn857Author Commented:
Sorry, I guess I didn't explain myself fully enough - I'm not trying to read into a TMemo or anything like that. I'm just doing a regular "ReadLn" procedure on a text file and wondering how big this text file on disk can be.

Thanks
   Shawn
0
mlmccCommented:
When you do a readln you don't read the entire file just 1 line at a time.

Is the file a single line (no <CR> <LF>)

mlmcc
0
aikimarkCommented:
You might be running up against the 32-bit limitation of 2GB for position in a file.  There are ways around this limitation, but you will need to use something other than native Delphi functions.
0
Geert GOracle dbaCommented:
if you are reading a "record"
do you know upfront that record size ?

usually a "record" holds some info about it
like a record size ...

an alternative is to use the Read function
and do the same as readln ... except instead of reading 1 char at a time ... read blocks of data at a time

the 64-bit compiler might also solve your problem ...
0
aikimarkCommented:
Do you know about stream processing routines?  That is a good place to start for your code modification.

Depending on your experience level, you might look at some libraries that wrap the necessary underlying routines to read/write files greater than 2GB.
Example:
http://gp.17slon.com/gp/gphugefile.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shawn857Author Commented:
Thank you Aikimark.

Cheers
   Shawn
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.