Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to know if a file is opened for writing by another application

How to know if a file is opened for writing by another application

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminhelptutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hatemtaleb
    wrote on last edited by
    #1

    Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.

    S H I 3 Replies Last reply
    0
    • H hatemtaleb

      Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.

      S Offline
      S Offline
      sashoalm
      wrote on last edited by
      #2

      What I'm suggesting isn't very sophisticated but... you can make an empty second file with the same name and some identifying string after you've finished uploading the big file and make the server process look for it. So if your big file is named bigfile.dat, then then your process should look for a file named "bigfile.dat.isreadyforprocessing", then you remove the last part of the name, delete this empty file and you have the name of the file you should be processing.

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      1 Reply Last reply
      0
      • H hatemtaleb

        Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Im not sure it this[^] helpful?

        1 Reply Last reply
        0
        • H hatemtaleb

          Hi, Here is the issue: - I am uploading a big file into a server using ftp - on the server, a process will start processing the file as soon as it detect is presence ( even incomplete file ) is there any why that this process can guess whether the file is finished uploading or not? thanks in advance.

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          This also may be simple, but couldn't you just try to open the file? If the ftp server is still adding data into it, your exclusive-share-read open will fail? Just try later! Or add the .readyforprocessing file thingy - it's cunning as well as simple! Iain

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups