Setting file (.txt) attribute at run time. - Programmer

This is a discussion on Setting file (.txt) attribute at run time. - Programmer ; My C++ program needs to set the attribute of a ".txt" file to "read
only" before and after it writes to this file.
Any suggestions would be appreciated.
Mike...

Setting file (.txt) attribute at run time.

My C++ program needs to set the attribute of a ".txt" file to "read
only" before and after it writes to this file.

Any suggestions would be appreciated.

Mike

Re: Setting file (.txt) attribute at run time.

kshare_103@hotmail.com (Mike) wrote:
> My C++ program needs to set the attribute of a ".txt" file to "read
> only" before and after it writes to this file.

If you set a file to read only before a write, the write would fail.

Bill, it is written.

--
The address in the reply to header is correct, but I'll
read it quicker if you drop the word "usenet".

Re: Setting file (.txt) attribute at run time.

Mike writes:
> My C++ program needs to set the attribute of a ".txt" file to "read
> only" before and after it writes to this file.

I would explore the ATTRIB command of MS-DOS called via. system().

Re: Setting file (.txt) attribute at run time.

"Mike" wrote in message
news:8f3383e0.0311060041.391c883c@posting.google.c om...
> My C++ program needs to set the attribute of a ".txt" file to "read
> only" before and after it writes to this file.
>
> Any suggestions would be appreciated.