17 #include "mysys_priv.h"
19 #include "mysys_err.h"
36 File my_create(
const char *FileName,
int CreateFlags,
int access_flags,
40 DBUG_ENTER(
"my_create");
41 DBUG_PRINT(
"my",(
"Name: '%s' CreateFlags: %d AccessFlags: %d MyFlags: %d",
42 FileName, CreateFlags, access_flags, MyFlags));
44 fd= my_win_open(FileName, access_flags | O_CREAT);
46 fd= open((
char *) FileName, access_flags | O_CREAT,
47 CreateFlags ? CreateFlags : my_umask);
50 if ((MyFlags & MY_SYNC_DIR) && (fd >=0) &&
51 my_sync_dir_by_file(FileName, MyFlags))
53 my_close(fd, MyFlags);
57 rc= my_register_filename(fd, FileName, FILE_BY_CREATE,
58 EE_CANTCREATEFILE, MyFlags);
65 if (unlikely(fd >= 0 && rc < 0))
68 my_close(fd, MyFlags);
69 my_delete(FileName, MyFlags);