That should never become an issue! Sounds like you have the file on a network share and you don't know if someone else already has it open. Change that deployment ASAP, it's been known to corrupt files. Dedicate one machine to be the host, all others use Open Remote.
As to figuring out if you are the host; use the Get() functions:
Get ( HostIPAddress )
If you are a remote client these should be different
I have missed that. Very good option. Thanks.
No I am using a single hosted computer.
But I am using "save copy as" as a backup.
This option doesn't work on the remote file.
This is why the "backup message" won't be necessary when closing a remote file.
On a related note here's a handy calculation to determine if the database is on filemaker server (and if it's server 13 ie able to perform scripts on server):
Let ( [
host = Get ( HostApplicationVersion ) ;
hostVersion = GetAsNumber ( host )
Position ( host ; "Server" ; 1 ; 1 ) and hostVersion ? 13 and hostVersion < 14
I believe the question mark was intended to be an inequality ">".
As Wim says; Change that deployment ASAP.
You are playing a dangerous game by opening files like that.
Best thing is to use a server. Otherwise use a dedicated machine that opens the files, stored on a local drive to that machine and let clients connect via Open Remote.
Both Wim and I can talk on and on as to why you should always host your database files on a server.
If you don't have hardware and knowledge to do it your self, seriously consider going to a hosting company.
If you are using peer-to-peer sharing, try Get(MultiUserState)
If it returns 2, network sharing is on and the user is accessing the file from a client computer (don't-run backup)
Otherwise iit returns 0 or 1, run the backup.
Thank you very much.
Very good option.
Thank you for your help.
But I am not understanding the problem that your are mentioning.
I am already using a dedicated machine to open the files that are stored on a local drive to that machine. And all clients are connected to that file via Open Remote.
And I think that using a server that costs a lot is not mandatory it is not needed (I have usually 3 to 5 posts connected to my solution via Filemaker Pro 13).
Thank you for your reply.
It is a good option for Server. But I am only using Filemaker Pro for the time being.
That was not clear from your original post.
And even with just a few users, there are real benefits in using FMS:
- it's a true server, background process
- allows for live backups, much more efficient than any "save a copy as" routine
Give it some thought...
Something to be aware of: When performing nightly, hourly, etc. backups of the host computer, be sure to exclude the actual file from the backup routine. You don't want to backup a FileMaker file while it is open. Only backup the "backups" folder.
But doesn't save as copy script step works when the file is open?
And if it is done that way, I don't think that it can harm the file
We cannot do it for a closed file
In contrast, it is for sure forbidden to manually do a copy of an opened file
What Todd is talking about is any non-FM backup process that might be trying to copy the hosted file.
Sorry that I wasn't clear. Thanks, Wim, for clarifying. I was referring a situation where you have another software trying to backup the file. It is possible to manually copy an open file but you run the risk of corruption.
You are sure about that.
We must never do a copy when the file is open