Is there anyway to delete (truncate) the contents of a file that's already attached to a stream object, like fstream or ifstream? I could do it by closing the file and reopening it with ios::trunc specified, but I'd rather not close the file as there's a good chance another instance of the application might grab it since the file would become unlocked when it was closed...
I'm really desperate for help, so if you have any ideas at all, please share them.