bizzu
12-05-2004, 18:35
Vorrei aprire in append un CStdioFile, per intenderci come in C si farebbe con il parametro "a". Nell'MSDN l'unico riferimento ad una cosa del genere è
CFile::modeNoTruncate Combine this value with modeCreate. If the file being created already exists, it is not truncated to 0 length. Thus the file is guaranteed to open, either as a newly created file or as an existing file. This might be useful, for example, when opening a settings file that may or may not exist already. This option applies to CStdioFile as well.
Io ho provato a fare così:
outfile.Open(sourceFile, CFile::modeFreate | CFile::modeNoTruncate | CFile::typeText ) )
ma mi dà un errore in fase di chiusura del file! Precisamente "Debug error! Abnormal program termination".
Ho provato in altri modi, con solo modeWrite e con modeWrite | modeNoTruncate, ma (pur non avendo errori) il file viene sovrascritto.
CFile::modeNoTruncate Combine this value with modeCreate. If the file being created already exists, it is not truncated to 0 length. Thus the file is guaranteed to open, either as a newly created file or as an existing file. This might be useful, for example, when opening a settings file that may or may not exist already. This option applies to CStdioFile as well.
Io ho provato a fare così:
outfile.Open(sourceFile, CFile::modeFreate | CFile::modeNoTruncate | CFile::typeText ) )
ma mi dà un errore in fase di chiusura del file! Precisamente "Debug error! Abnormal program termination".
Ho provato in altri modi, con solo modeWrite e con modeWrite | modeNoTruncate, ma (pur non avendo errori) il file viene sovrascritto.