- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello:
I have recently upgraded my compilerto version11.1.065, and I have a question about checking if a file is read-only. I am using GETFILEINFOQQ function, and checking the FILE$READONLY bit againstinfo%permit. It is returning a value of 0, indicating that the file is not read-only. Indeed, if I check the properties of the file, I see that the"Read-only" box is not checked.
However, the file resides on a server, and I only have read-access to that directory (and its contents) of the server. So, even though the file's propertiesdo not indicate read-only, for me the file is read-only. In this case, whatshould be the proper return value from GETFILEINFOQQ? Like I mentioned, it is returning thatthe fileis not read-only, but has that possibly changed in the last few versions of IVF? I was running 11.1.038, and I don't think I ran into this problem (though, perhaps I never checked carefully enough).
Thanks.
Michael
I have recently upgraded my compilerto version11.1.065, and I have a question about checking if a file is read-only. I am using GETFILEINFOQQ function, and checking the FILE$READONLY bit againstinfo%permit. It is returning a value of 0, indicating that the file is not read-only. Indeed, if I check the properties of the file, I see that the"Read-only" box is not checked.
However, the file resides on a server, and I only have read-access to that directory (and its contents) of the server. So, even though the file's propertiesdo not indicate read-only, for me the file is read-only. In this case, whatshould be the proper return value from GETFILEINFOQQ? Like I mentioned, it is returning thatthe fileis not read-only, but has that possibly changed in the last few versions of IVF? I was running 11.1.038, and I don't think I ran into this problem (though, perhaps I never checked carefully enough).
Thanks.
Michael
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Michael,
The documentation does say it only checks the permissions on the file, not the path of the file. I am curious of the behavior has changed though between releases (I am not seeing anything on my side that would suggest it would). Do you have the test case that of your code that does the call to GETFILEINFOQQ? I would like to reproduce it here and test with 11.1.038.
Thanks,
The documentation does say it only checks the permissions on the file, not the path of the file. I am curious of the behavior has changed though between releases (I am not seeing anything on my side that would suggest it would). Do you have the test case that of your code that does the call to GETFILEINFOQQ? I would like to reproduce it here and test with 11.1.038.
Thanks,
------
Wendy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Michael,
One way to check whether the folder is read only would be to attempt to open a temporary file with NEW, READONLY attributes, and checkingIOSTAT for the open.
David
One way to check whether the folder is read only would be to attempt to open a temporary file with NEW, READONLY attributes, and checkingIOSTAT for the open.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello:
Thank you for your replies.
Wendy: I have checked with a coworker that has 11.1.038 and I guess I was mis-remembering. It does look likeit's always checkingfile properties for the read-only flag. I am looking for a way to check if the file is read-only for me specifically.
David: Thanks - interesting suggestion. I'll have to give that a try. What is the reasoning behind needing the READONLY attribute to test the directory?
Thanks.
Michael
Thank you for your replies.
Wendy: I have checked with a coworker that has 11.1.038 and I guess I was mis-remembering. It does look likeit's always checkingfile properties for the read-only flag. I am looking for a way to check if the file is read-only for me specifically.
David: Thanks - interesting suggestion. I'll have to give that a try. What is the reasoning behind needing the READONLY attribute to test the directory?
Thanks.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Michael,
Sorry, I should have had WRITEONLY - you want to force the file open so that your app has exclusive access to the file. I guess READWRITE would have the same effect.
Regards,
David
Sorry, I should have had WRITEONLY - you want to force the file open so that your app has exclusive access to the file. I guess READWRITE would have the same effect.
Regards,
David
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page