Jump to content

maximum lenght for fileread


Recommended Posts

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?

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...