#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 by , on Aug 28, 2008 at 10:00:07 PM
| Milestone: | Future Release |
|---|---|
| Version: | 3.2.12.0 |
comment:2 by , on Nov 2, 2008 at 2:10:20 AM
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 by , on Jan 9, 2009 at 5:22:23 PM
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.
follow-up: 5 comment:4 by , on Jan 9, 2009 at 6:37:13 PM
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 by , on Jan 9, 2009 at 11:20:18 PM
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 by , on Feb 11, 2009 at 7:23:34 AM
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:7 by , on Feb 20, 2010 at 11:26:38 PM
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 by , on Feb 21, 2010 at 1:13:25 AM
Or, a newer version since it's been fixed since 3.3.5.3.
comment:9 by , on Jul 21, 2013 at 11:32:31 PM
| Resolution: | → Rejected |
|---|---|
| Status: | assigned → closed |

Automatic ticket cleanup.