Closing Files from the Command Line

The acuserve unlock command provides a mechanism for closing stranded files from the command line. Before you use -unlock, it is best to generate a current AcuServer status report using acuserve -info. The status report provides a complete list of open files on the server, including client name, user name, PID, FID, file type, and the file name of each open file. With information from this report, you can use -unlock to close specific files.

The -unlock command syntax is:

acuserve -unlock [server] [-a] [-c client] [-u user] 
                     [-p PID] [-f FID] [-n portnum]

-unlock has two modes of operation:

Optional arguments to -unlock include:

Option Description
server Specifies the name of the AcuServer server. If no server is specified, the server is assumed to be the local host.
-a Causes all open files on the server to be immediately closed. -a does not ask the user for confirmation before closing all files.
-f FID Causes the file associated with the specified FID to be unlocked and closed. -f must be followed by a space and the FID of an open file.
-c client    When -c is used with no other options, acuserve unlocks and closes all files and sockets held open for the named client on the current host. -c must be followed by a space and the name of an AcuServer client. Use -c in combination with the server option to specify a server other than the current host. -c can be qualified by the -u or -p options.
-u user Used as a qualifier to the -c option. -u must be followed by a space and the name of an AcuServer user. The -c client -u user combination causes acuserve to close all files and sockets associated with the named user on the named client.
-p PID    Used as a qualifier to the -c option. -p must be followed by a space and the PID of a client process. The -c client -p PID combination causes acuserve to close all files and sockets associated with the specified PID on the named client.
-n port Identifies a particular instance of the acuserve program by port number. The -n must be followed by a space and then an integer, for example, 6524. This option causes only those files associated with the specified instance of the acuserve program to be unlocked and closed. If no port number is specified, files for the default port are unlocked and closed.