tags:

views:

45

answers:

1

Hi,

I am developing program on window's using msys and mingw. I want to have similar function as provided by WINAPI CreateFile(). Is there any solution for this?

Regards, Dhaval

+1  A: 

The POSIX api for opening files is fopen - or documented @ OpenGroup.

Chris Becke
Can I open file with sharing mode similar to "FILE_SHARE_DELETE" defined for CreateFile()? which i guess is related to ACL implemented in NTFS file system.
Dhaval
Looking at the documentation it doesn't look like fopen has any delete-on-close functionality. You will need to use CreateFile directly to access that.
Chris Becke
How to use it directly in mingw environment?
Dhaval
The mingw environment is meant to setup a windows sdk build environment: i.e. little more than a `#include <windows.h>` is necessary - then just call the windows APIs you want.
Chris Becke
Thanks Chris, I will try to make it work as per your suggestion.
Dhaval
It works! this link was helpful http://www.osix.net/modules/article/?id=670
Dhaval