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...

+ Reply to Thread
Results 1 to 4 of 4

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

  1. 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

  2. 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".

  3. 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().



  4. 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.


    SetFileAttributes

    --
    Tim Robinson (MVP, Windows SDK)
    http://www.themobius.co.uk/



+ Reply to Thread