how to set read only attribute for text file in C

Discussion in 'Programmer's Corner' started by bignick270, Jan 6, 2010.

  1. bignick270

    Thread Starter Active Member

    Mar 25, 2009
    36
    0
    Is there a simple way to make a text file read only in standard C (not C++) in windows?

    I know how to write to and read from text files in C but changing the attributes would be useful in my application.
     
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,019
    In regular C take a look at the access function.

    In .Net you can use File.SetAttributes.
     
Loading...