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. Checking if a file has been opened by any process and remains open

Checking if a file has been opened by any process and remains open

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 3 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.
  • J Offline
    J Offline
    Jose M Castellanos
    wrote on last edited by
    #1

    Hello: I am developing a library that must automatically detect new files in a certain directory and then process them. If a user creates a file (such a text one) using any program in the directory and he edits and saves the file without closing, no action has to be taken. The action has to wait until we are sure the file edition is complete and file is closed. How can I check wether the file has been opened by any process in the local machine or even remotely? Is it possible to get a notification when the file is closed by the user? I should work out the problem using no MFCs. Any help will be really welcomed. ;P Jose M. Just re-entering programming world after a long break.

    R C 2 Replies Last reply
    0
    • J Jose M Castellanos

      Hello: I am developing a library that must automatically detect new files in a certain directory and then process them. If a user creates a file (such a text one) using any program in the directory and he edits and saves the file without closing, no action has to be taken. The action has to wait until we are sure the file edition is complete and file is closed. How can I check wether the file has been opened by any process in the local machine or even remotely? Is it possible to get a notification when the file is closed by the user? I should work out the problem using no MFCs. Any help will be really welcomed. ;P Jose M. Just re-entering programming world after a long break.

      R Offline
      R Offline
      Rajesh match
      wrote on last edited by
      #2

      look for CFile::shareExclusive in MSDN regards Rajesh

      1 Reply Last reply
      0
      • J Jose M Castellanos

        Hello: I am developing a library that must automatically detect new files in a certain directory and then process them. If a user creates a file (such a text one) using any program in the directory and he edits and saves the file without closing, no action has to be taken. The action has to wait until we are sure the file edition is complete and file is closed. How can I check wether the file has been opened by any process in the local machine or even remotely? Is it possible to get a notification when the file is closed by the user? I should work out the problem using no MFCs. Any help will be really welcomed. ;P Jose M. Just re-entering programming world after a long break.

        C Offline
        C Offline
        cmk
        wrote on last edited by
        #3

        http://www.codeproject.com/file/FileSpyArticle.asp[^] ...cmk Save the whales - collect the whole set

        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