Modify

Opened 14 years ago

Closed 14 years ago

#1684 closed Bug (Fixed)

FileRead: negative "count" value in binary mode causes "Error allocating memory"

Reported by: ChiDragon Owned by: Jpm
Milestone: 3.3.7.0 Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: FileRead binary Error allocating memory Cc:

Description

Au3Check does not throw any error. The memory allocation error simply pops up when the script is executed.

The Help file gives no indication of what acceptable values of "count" may be, or how to force reading the whole file when "count" is specified. Negative values in text-mode do in fact cause the entire file to be read.

Sufficient to reproduce:

$Handle = FileOpen (@ScriptFullPath, 16)
$WholeFile = FileRead ($Handle, -1)
FileClose ($Handle)

As mentioned, no problems if "0" is used instead of "16" to read in text-mode. The whole file is simply read just the same as if "count" was never specified.

$Handle = FileOpen (@ScriptFullPath, 0)
$WholeFile = FileRead ($Handle, -1)
FileClose ($Handle)
MsgBox (0, "", $WholeFile)

Attachments (0)

Change History (1)

comment:1 Changed 14 years ago by Jpm

  • Milestone set to 3.3.7.0
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5886] in version: 3.3.7.0

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.