RFile
Open()
The following code fragment opens an existing file, without replacing its existing data, and creates the file if it does not already exist:
TInt err=file.Open(fsSession,fileName,shareMode);
if (err==KErrNotFound) // file does not exist - create it
{
err=file.Create(fsSession,fileName,shareMode);
}
This code fragment sets the hidden and read-only attributes, and clears the archive attribute. All others are unaffected:
file.SetAtt(KEntryAttHidden|KEntryAttReadOnly,KEntryAttArchive);