Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check file is opened!!!

Status
Not open for further replies.

cmancre

Programmer
Jan 30, 2005
35
0
0
PT
This is the situation:

cp /path/file /path/file.new <---file got variable MB

During the copy (it will take some time) is there a way to check if file.new is completly or not completly copied?
 
ups...

During the copy (it will take some time) is there a way to check if file.new is completly or not completly copied?
IN PHP
 
if you are performing the file copy in php (and your code above indicates that you are doing it from a *nix shell), i believe that the script will pause until the file activity is finished.
 
You could use the filesize() function and compare the from and to files. If they are different it failed.
If you wanted another way to check even if the filesize were the same you could create some kind of check value aroubd MD5 or some kind of CRC (Cyclic Reduncancy Check) value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top