Modify

Opened 11 years ago

Closed 6 years ago

#546 closed Feature Request (Rejected)

FileOpen() Shared/exclusive access

Reported by: ChrisL Owned by: Valik
Milestone: Component: AutoIt
Version: Severity: None
Keywords: FileOpen, Exclusive, FILE_SHARE_NONE, FILE_SHARE_READ, FILE_SHARE_WRITE Cc:

Description

I would find it useful to add a new flag or flags to the FileOpen() function for FILE_SHARE_NONE, FILE_SHARE_READ and FILE_SHARE_WRITE.

Sometimes it is necessary to read and write to a file exclusively and if we could use an optional flag at the end of FileOpen() for shared access or exclusive access.

I don't know if you could do it by adding another numerical flag to the existing set, or have a 3rd optional parameter 1 for exclusive and 0 for Shared (deault)

I am aware that there are work arounds for this but it would be much neater for AutoIt to support it natively.

Thanks

Attachments (0)

Change History (9)

comment:1 Changed 11 years ago by TicketCleanup

  • Milestone Future Release deleted
  • Version 3.2.12.0 deleted

Automatic ticket cleanup.

comment:2 Changed 11 years ago by Valik

Those flags have nothing to do with locking a file for exclusive access. Locking a file is not done at creation/open time but rather on-demand. I don't know about adding a FileLock() function. I'm not sure of the usefulness of it.

comment:3 Changed 11 years ago by Jpm

If I understand ChrisL wants to defined at open time how he wants to use the file, allowing a specific sharing.
For me that does not imply File Locking mechanism.

comment:4 follow-up: Changed 11 years ago by Valik

I've already explained this to ChrisL. The method he describes is bad. I explained again here (link is to a private forum). The basic gist is specifying a sharing is prone to 1) Failing; 2) Not working as expected. I will implement a FileLock() function when I get a few minutes to write it up. But we are not going to do what ChrisL suggest because it's not really a good way to go about this.

comment:5 in reply to: ↑ 4 Changed 11 years ago by Jpm

Replying to Valik:

I've already explained this to ChrisL. The method he describes is bad. I explained again here (link is to a private forum). The basic gist is specifying a sharing is prone to 1) Failing; 2) Not working as expected. I will implement a FileLock() function when I get a few minutes to write it up. But we are not going to do what ChrisL suggest because it's not really a good way to go about this.

Thanks, that not what the report was describing but if he really need a lock file mechanism he should have describe as such

comment:6 Changed 11 years ago by Jpm

  • Owner set to Valik
  • Status changed from new to assigned

comment:7 Changed 10 years ago by LiquidFire

Since files FileOpen()ed from AutoIt are now locked for exclusive access by the process since v3.3.4.0, this is really important as there's no other way to get the old functionality back. You can't e.g. read a log file as it's being generated. This change breaks my script and there seems to be no way around it apart from using an older version of AutoIt.

comment:8 Changed 10 years ago by Valik

Or, a newer version since it's been fixed since 3.3.5.3.

comment:9 Changed 6 years ago by Jon

  • Resolution set to Rejected
  • Status changed from assigned to closed

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 Valik.
Author


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

 
Note: See TracTickets for help on using tickets.