Modify

Opened 16 years ago

Closed 16 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 by anonymous, 16 years ago

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 by Jon, 16 years ago

Milestone: 3.3.7.0
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed by revision [5753] in version: 3.3.7.0

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.