How can a folder be locked?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Man4ish
    New Member
    • Mar 2008
    • 151

    How can a folder be locked?

    How can a folder be locked?I am working on some logic
    Ist Program
    1. to create a folder // done
    2. write all the files in the directory generated in the program // done
    3. lock the folder //How it can be done?

    IInd Program
    open the directory (by unlocking) // How it can be done?
    read and execute the file. //possbile

    Thanks in advance.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    I think you would first need to ascertain what "locked" means in this context, then we may be able to suggest ways to do it.

    For instance does it mean just set the read only flag?

    Comment

    • Man4ish
      New Member
      • Mar 2008
      • 151

      #3
      LOck means, no one can open and see the content in the folder and other program in C++ read and execute it. Thanks in advance.

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        That is clearly not possible because the only way to access any folder or file is to use a program.

        If you are using a system that supports user accounts you could create a special user account and make the folder owned by that account and then only grant access rights to that user and then only that user and any administrators of the system would be able to access the folder/files.

        Then in your programs you could access the folder using that user.

        Comment

        • george666
          New Member
          • Jul 2008
          • 28

          #5
          > That is clearly not possible

          On Windows, simply use Security apis.

          Comment

          Working...