Modify

Opened 9 years ago

Closed 9 years ago

#1515 closed Bug (Fixed)

FileOpen for Read fails on already opened file

Reported by: M23 Owned by: Jon
Milestone: 3.3.7.0 Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

From v3.3.5.3 Beta release notes:
Fixed: Regression in FileOpen() where it wasn't allowed to open files in read mode if they were already open in write mode.

In v3.3.6.0 you cannot open a file for reading if it is already open:

$h_write = FileOpen('test.txt', 1)

$h_read = FileOpen('test.txt', 0)
If $h_read = -1 Then
    FileClose($h_write)
    MsgBox(0, @AutoItVersion, 'Failed to open handle for read')
EndIf

FileClose($h_write)
FileDelete('test.txt')

The same happens when the file is opened in other apps (although I have now learnt that Notepad does NOT lock its open files).

Raised in http://www.autoitscript.com/forum/index.php?showtopic=109436&pid=780472&st=0&#entry780472 - post # 6 and onwards.

M23

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by anonymous

Also You can't open the same file for reading and for writing. This was possible with the previous versions until 3.3.2.

comment:2 Changed 9 years ago by Jon

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

Fixed by revision [5753] 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 Jon.
Author


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

 
Note: See TracTickets for help on using tickets.