Главная страница | назад





Article #15977: Constructing TFile

 Question and Answer Database

FAQ977C.txt   Constructing TFile
Category   :Windows API
Platform    :All
Product    :BC++  5.x

Question:

The TFile class defines Open() as:

int Open( const char* name, uint16 access, uint16 permission );

Anybody got a clue as to what legal values for access and 
permission are? 

Answer:

Those flags are enum'd in \include\classlib\file.h as:
access flags:
ReadOnly = O_RDONLY
ReadWrite = O_RDWR
WriteOnly = O_WRONLY
Create = O_CREATE | O_TRUNC
CreateExcl = = O_CREATE | O_EXCL
Append = O_APPEND

permissions flags:
PermRead = S_IREAD
PermWrite = S_IWRITE
PermRdWr = S_IREAD | S_IWRITE

Dont forget scope resolution when using these. 
e.g. TFile::ReadWrite

7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99