The software I'm working on right now can have multiple users. But each user needs a copy of a resource file, that we call RES___
On a network, there can be many users, each user will have a copy of the file RES___ which is named RES001, RES002, etc.
When the user logs on, the file is copied from the original RES___ using
Naturally, _resouce contains the path and file name (ex _resource = "c:\blah\RES001.dbf" to be created.
On a particular client's system, they are getting error 1705: File access denied on the COPY TO command.
I would like to be able to test and see if the file is in use by another program. Checking read-only attributes doesn't work, because I can still get the error even if the file is not read-only (but apparently open by something else).
The test i tried is to run our software, and before creating RES001, i opened RES001 (exclusively and shared..tried both..) in another instance of foxprow. Before copying, i check the attributes, read-only is not there, and i get error 1705.
If I run the software normally, that is, without opening RES001 prior to creating a new instance, i can get in fine. Even if the file exists, it's overwritten.
I figure, if I can gather information about what is keeping the file open, then I can get this problem off my desk. It's been around for awhile. So far, when I need to solve this problem so the clients can use the number of licenses they purchased, i've rebooted the machine. Which works for a day, an afternoon, not very long.
One could say that the files aren't being closed properly, but then we'd be seeing this problem with all our clients.
With at least 200 other clients using the same software without this problem, its a strange case, one that's eating up a lot of my time.
Oh, Microsoft's Terminal Server is being used by the client, for some of the users who are outside the city to use the same database. I've spoken with the admin of the client's network, and he's assured me that all users close Terminal Server properly, and even then there are only two who connect maybe twice or thrice a week. (by properly i mean logging out and not closing using the x in the top right corner of their Server window.)
To recap, i'd appreciate any help in finding a way to find out what program/user is holding access to the file in foxpro2.6 code would be greatly appreciated.
Thanks
On a network, there can be many users, each user will have a copy of the file RES___ which is named RES001, RES002, etc.
When the user logs on, the file is copied from the original RES___ using
Code:
COPY TO ( _resource )
On a particular client's system, they are getting error 1705: File access denied on the COPY TO command.
I would like to be able to test and see if the file is in use by another program. Checking read-only attributes doesn't work, because I can still get the error even if the file is not read-only (but apparently open by something else).
The test i tried is to run our software, and before creating RES001, i opened RES001 (exclusively and shared..tried both..) in another instance of foxprow. Before copying, i check the attributes, read-only is not there, and i get error 1705.
If I run the software normally, that is, without opening RES001 prior to creating a new instance, i can get in fine. Even if the file exists, it's overwritten.
I figure, if I can gather information about what is keeping the file open, then I can get this problem off my desk. It's been around for awhile. So far, when I need to solve this problem so the clients can use the number of licenses they purchased, i've rebooted the machine. Which works for a day, an afternoon, not very long.
One could say that the files aren't being closed properly, but then we'd be seeing this problem with all our clients.
With at least 200 other clients using the same software without this problem, its a strange case, one that's eating up a lot of my time.
Oh, Microsoft's Terminal Server is being used by the client, for some of the users who are outside the city to use the same database. I've spoken with the admin of the client's network, and he's assured me that all users close Terminal Server properly, and even then there are only two who connect maybe twice or thrice a week. (by properly i mean logging out and not closing using the x in the top right corner of their Server window.)
To recap, i'd appreciate any help in finding a way to find out what program/user is holding access to the file in foxpro2.6 code would be greatly appreciated.
Thanks