Opened 18 years ago
Closed 13 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 by , 18 years ago
| Milestone: | Future Release |
|---|---|
| Version: | 3.2.12.0 |
comment:2 by , 17 years ago
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 , 17 years ago
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 , 17 years ago
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 , 17 years ago
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 , 17 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:7 by , 16 years ago
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:9 by , 13 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | assigned → closed |

Automatic ticket cleanup.