You might want to close a specific open file for a connection for the following scenario:
A file in a shared storage are has been held open for a very long time. The application that is being used (such as Microsoft Word or OpenOffice) has locked the file for write access to other users.
You know which user has the file open, and the user is not available to close the file, or cannot close the file.
The user has multiple files open.
You want to close only one of the files.
Use NCPCON to view the list of open files for a connection, then close a specific open file:
Open a terminal console, then log in as the root user.
At the console prompt, enter the following command to get a list of NCP connections for a given file:
ncpcon files list f=filename
Replace filename with the Linux path for the file, including the filename, such as /media/nss/VOL1/Document.rtf.
For example, the following response shows that the admin user in connection 15 has a lock held open on the file:
# ncpcon files list f=/media/nss/VOL1/Document.rtf ... Executing " files list f=/media/nss/VOL1/Document.rtf" Connection User Name Rights 15 .CN=admin.O=novell.T=SUMMER. 0x9 Count of locks found on the file /media/nss/VOL1/Document.rtf: 1. ... completed OK [elapsed time = 1 Second 4294051 msecs 640 usecs]
Visually confirm that you have the correct file and connection.
Enter the following command to close the open file by filename:
ncpcon files close f=filename
For example, enter
ncpcon files close f=/media/nss/VOL1/Document.rtf
You can alternatively specify the connection number to close all open files for that connection, including the filename of interest.
ncpcon files close c=connection_number
For example, enter
ncpcon files close c=15
Verify that any temporary file that the application opened for the file has been removed from the folder by the application. Otherwise, the user might not be able to save changes to the file of interest.
For more information about temporary files created by an application, see Step 5 in Section 9.9, Viewing Open Files for an NCP Server Connection, and Closing All Open Files.
In Novell Remote Manager, select
> .Click the volume’s name link, then navigate the directory structure to the folder where the open file was located.
Use the Search feature to find a temporary file for the open file, such as ~$myfile.doc or .~lock.myfile.odt.
Click the
icon next to the file name.On the File Information page, click
.