Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation c++ how to clear file contents in use

    Hi,

    there is a program that outputs to a txt file over time.
    and I have a program that reads from the file.
    but I would like to clear the file contents because the file is getting large.
    but it seems the other program is still using it and it won't let me delete the file or modify its contents.

    is there a way that I can delete the entire file or merely its contents without turning off the program that is appending to it?

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I could be wrong, but I think that unless the other program has opened the file in shared mode, you may be out of luck.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •