UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » HOW TO ENSURE A FILE IS NOT BEING WORKED ON BY ANY OTHER PROCESS...

#1 2008-01-10 06:11 AM

shivamasam
Member
Registered: 2007-03-13
Posts: 8

Re: HOW TO ENSURE A FILE IS NOT BEING WORKED ON BY ANY OTHER PROCESS...

HI

I AM FACINGA PROBLEM IN "C" FILE HANDLING. I HAVE A FTP SCRIPT WHICH TRANSFERS SOME FILES TO MY SOLARIS SERVER IN A PARTICULAR DIRECTORY, AND I HAVE WRITTEN A "C" APPLICATION WHICH WILL MONITOR THIS DIRECTORY FOR ANY NEW FILE, WHEN IT FINDS A NEW FILE IT PICKS IT UP FOR READING IT.

NOW THE PROBLEM IS WHEN A FILE IS "UNDER" TRANSFER BY FTP, MY APPLICATION IS STILL PICKING IT FOR PROCESSING WHICH IS NOT A COMPLETE FILE.
IS THERE ANY METHOD IN "C", WHICH SPECIFIES WHETHER A FILE IS COMPLETE OR IT IS NOT OPENED OR NOT BEING WORKED ON BY ANY OTHER PROCESS. BY DOING SO I WANT TO ENSURE MY APPLICATION WILL ALWAYS OPEN A COMPLETE AND CLOSED FILE.

PLEASE SUGGEST ME ON HOW CAN I ACHIEVE THIS?

Offline

  • Index
  • » C
  • » HOW TO ENSURE A FILE IS NOT BEING WORKED ON BY ANY OTHER PROCESS...

Board footer

Powered by FluxBB