HP OpenVMS Systems

ask the wizard
Content starts here

Automated FTP File Copies, Locking?

» close window

The Question is:

Have run into an odd file locking problem.
In one of our applications, we use a DCL procedure
to open, write to, and close a file which is then
sent via FTP to our barcode print server.
Occasionally, the file will never reach the print
server because the FTP command to copy the file fails
with this error:
"550 temp.pas: The process cannot access the file
because it is being used by another process."
Two questions:
1) Is VMS handling file locking asynchronously such
that sometimes the lock has not been cleared before
the copy is attempted?
2) The problem appears (just a guess) to be worse
when the number of temporary log files in the directory
has been allowed to balloon (say, 10 - 15,000).
Could VMS having to search thru some directory tree
in order to remove the lock be causing the delay
when the number of files/versions in the directory
is out of control?
Thanks for your input.

The Answer is :

  It would certainly appear that something is writing to a file or
  directory when the FTP command arrives.
  1: if operations were not asynchronous, locks would not be needed.
  2: larger directories can certainly slow operations involving adding
  or removing files within a directory, and can slow the extension of
  the directory file itself.
  Options include NFS (served directories) and FTSV/FTSO (restartable
  copy) mechanisms, and sequences that involve renaming the files
  that are to be transfered.  Other options include ODBC and JDBC
  and similar; mechanisms which allow the file data to be served.

answer written or last revised on ( 17-APR-2003 )

» close window