Alternative to iS :: NOCREATE AND os :: NorePlace
In pre-standard C , certain implementations of
FSTREAM FS ("FNAME", iOS_BASE :: IN); // Attempt Open for Read
IF (! fs)
{
// file doesn't exist; don't create a new one
}
Else // OK, File EXISTS. Close and Reopen in Write Mode
{
fs.close ();
FS.Open ("FNAME", iOS_BASE :: OUT); // Reopen for Write
}
You can Just Do The Opposite for ios :: NorePlace:
FSTREAM FS ("FNAME", iOS_BASE :: IN); // Attempt Open for Read
IF (! fs)
{
// file doesn't exist; Create a new one
fs.open ("FName", iOS_Base :: OUT);
}
Else // OK, File Exists; Close and Reopen in Write Mode
{
fs.close ()
FS.Open ("FNAME", iOS_BASE :: OUT); // Reopen for Write
}
//however, it see the ms vc6.0 can not help import fstream Perfectly