This exit program is called on each IFS file open.
The parameters are the file path and open mode. The open mode is a numeric value that is a combination of the following constants (hexadecimal):
_EAC_IFSOPEN_READ=1 read access
_EAC_IFSOPEN_WRITE= write access
_EAC_IFSOPEN_CREAT=4 file will be created if not exist
_EAC_IFSOPEN_EXCL=8 file must not exist before open (create is mandatory)
_EAC_IFSOPEN_TRUNC=10 truncate file
_EAC_IFSOPEN_APPEND=20 append file
_EAC_IFSOPEN_BINARY=40 binary mode
_EAC_IFSOPEN_BIGFILE=big file. Allows to open > 2Gb files.
Create mode:
_EAC_IFSMODE_RUSR 400 user can read (u+r)
_EAC_IFSMODE_WUSR 800 user can write (u+w)
_EAC_IFSMODE_XUSR 1000 user can execute (u+x)
_EAC_IFSMODE_RGRP 2000 group can read (g+r)
_EAC_IFSMODE_WGRP 4000 group can write (g+w)
_EAC_IFSMODE_XGRP 8000 group can execute (g+x)
_EAC_IFSMODE_ROTH 10000 others can read (o+r)
_EAC_IFSMODE_WOTH 20000 others can write (o+w)
_EAC_IFSMODE_XOTH 40000 others can execute (o+x)
Share mode:
_EAC_IFSSHARE_RDONLY 100 0000 read only share
_EAC_IFSSHARE_WRONLY 200 0000 write only share
_EAC_IFSSHARE_NONE 400 0000 no share (exclusive)
_EAC_IFSSHARE_RDWR 300 0000 read/write share.
If you need to test the open mode, you need to use a bitwise AND with the flag to test and see if the result is equal to that flag.
Note: the exit program can only deny or accept the file open.
A source sample is available in the EACSYSSRC file in EASYCOM library.