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. Detect if a folder is locked

Detect if a folder is locked

Scheduled Pinned Locked Moved C / C++ / MFC
csharpcomlinuxtoolsjson
3 Posts 3 Posters 1 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.
  • S Offline
    S Offline
    Sudhir Mangla
    wrote on last edited by
    #1

    In windows exporer if I open a file say "text.doc" present in "C:\office docs" folder. Now when performing operation lre renaming,moving or deleing that folder in windows will return error. Can If a folder in windows file systemis locked befor performing these operation programmatically. Can some one suggest some shell API or SDK function to do the job

    Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)

    R G 2 Replies Last reply
    0
    • S Sudhir Mangla

      In windows exporer if I open a file say "text.doc" present in "C:\office docs" folder. Now when performing operation lre renaming,moving or deleing that folder in windows will return error. Can If a folder in windows file systemis locked befor performing these operation programmatically. Can some one suggest some shell API or SDK function to do the job

      Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)

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

      Have a look at the CFile::Open() method. If it returns zero, then the pError parameter in it will have a description of the error.

      Nobody can give you wiser advice than yourself. - Cicero

      1 Reply Last reply
      0
      • S Sudhir Mangla

        In windows exporer if I open a file say "text.doc" present in "C:\office docs" folder. Now when performing operation lre renaming,moving or deleing that folder in windows will return error. Can If a folder in windows file systemis locked befor performing these operation programmatically. Can some one suggest some shell API or SDK function to do the job

        Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)

        G Offline
        G Offline
        Galatei
        wrote on last edited by
        #3

        The folder is not locked. It is file which is locked as opened and sanity checks for move,delete operations returns failure, because some/one file cannot be removed. What system really does when you order it to move folder, is to copy & delete every single file in folder, and when error occurs (like when file is opened), an error message is displayed, but folder is never being locked. Regards

        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