Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Using RFile


Using 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);
    }

[Top]


Using SetAtt()

This code fragment sets the hidden and read-only attributes, and clears the archive attribute. All others are unaffected:

file.SetAtt(KEntryAttHidden|KEntryAttReadOnly,KEntryAttArchive);