Thread: read only folder on Windows

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    read only folder on Windows

    Hello everyone,


    In my application I need to create a folder and make it read only to test whether my application could work with read only media.

    I have tried to set the property of a folder to read only (right click the mouse and make Read Only property enabled), but I find I still can create file into this folder.

    How to make a folder truly read only on Windows (e.g. can not create file into the folder)?

    Both programming ways and non-programming ways are appreciated. I am using Windows XP SP2.


    thanks in advance,
    George

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If you actually want to test if your application will work from a CD-ROM, I would recommend that you burn a CD of it, rather than trying to artifcially simulate that scenario.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You can't create a "read-only" folder the way you want. What you need is file permissions. This requires a NTFS file system.
    If you have XP Professional, you can use the Security tab to set security options (namely, deny file creation in that folder). If you have XP Home, you may have to try a 3rd party utility (such as Security Manager).
    Google is your friend on setting security permissions on folders.

    Btw, making the folder read-only will only make it impossible to overwrite (replace the dir with another).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. confused with read()
    By _EAX in forum Linux Programming
    Replies: 2
    Last Post: 03-17-2008, 04:14 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  3. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM
  4. Folder Password Programs (Windows)?
    By johnc in forum C Programming
    Replies: 8
    Last Post: 07-18-2002, 06:39 AM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM