Sign in to follow this  
Followers 0
Zomp

maximum lenght for fileread

4 posts in this topic

Sorry if this topic has already been discussed, I have not found aanything.

Which is the maximum length for $file in the following instruction?

$file = FileOpen("test.txt", 0)

What about if test.txt size is 1Gb or more?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

That probably wouldn't work.

The maximum teoretical string length autoit can handle is 2 GB but you won't come near that value.

It was under discussion some while ago and most people found that they could use up to somewhere between 400-700 MB :)

But even if you could, you should NEVER read a file that big into memory. I think you should buffer maybe 4-8 mb at a time for good speed :)

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Sorry if this topic has already been discussed, I have not found aanything.

Which is the maximum length for $file in the following instruction?

$file = FileOpen("test.txt", 0)
32 bits. That's just the file handle. :)

What about if test.txt size is 1Gb or more?

Assuming you mean to read the entire file into a string, I would review this topic first: A set of question for file

Executive summary: Although the theoretical limit for an AutoIt string is 2GB, there are practical limitations in the Win32 environment that make actual string manipulation fail somewhere between 100MB and around 210MB, depending on your resources (primarily RAM). In a 64-bit Windows environment, you may be able to go much larger, but I haven't had a chance to test that yet.

:)

Edit: Doh! Beaten to it by weaponx!

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0