Ensure the file completion ?

Hi,

I would like to copy a file from one location to another. But that particular file is not fully loaded. I like to copy a file once it's fully loaded or complete file. How to ensure whether file is fully loaded or complete file?.

-Thambi

Let me get this straight. You want to copy a file from one location to another, and you want to copy it only if the file is a complete file? As in, some application that might be creating the file has completed creating the file?

You can use the 'fuser -fu' command to check if a process is using the file. If there is none, you can go ahead and move the file. If a process is using the file, it likely to be the process that is creating the file, so you should wait, sleep and look back to run fuser again.

Hi,
Thanks for the inputs. I am using HP unix. I don't see this fuser command in my flavoure. Please suggest.

-Thambi

Are you sure? I have used fuser on HP-UX. Check your path.

I am sure , the fuser command NOT avaible in my HP.

$ which fuser
no fuser in /usr/bin /usr/bin /usr/ccs/bin /usr/contrib/bin /opt/nettladm/bin /opt/fc/bin /opt/fcms/bin /opt/upgrade/bin /opt/pd/bin /usr/bin/X11 /usr/contrib/bin/X11 /opt/hparray/bin /opt/perf/bin /opt/ignite/bin /opt/resmon/bin /usr/sbin/stm/uut/bin/progs /usr/symcli/bin /usr/local/bin /opt/cobol/bin /opt/OV/bin/OpC /opt/OV/bin /opt/graphics/common/bin /opt/gnome/bin /usr/sbin/diag/contrib /opt/mozilla /opt/wbem/bin /opt/wbem/sbin /opt/mx/bin /opt/perl/bin . /shpepr2/OraD11/Oracle/920/bin
$

Thambi,
I just checked my system and 'fuser' here is located at '/usr/sbin/',
which is not listed in your path.