~~Title: VFS_CreateFile~~ VFS_CreateFile && HANDLE && The function must return a **HANDLE** value that represents the file if the file was successfully opened or created. Directory Opus will pass this handle to the other file read/write API functions. && hVFSData && HANDLE && [in] The handle to the namespace instance data && lpFuncData && LPVFSFUNCDATA && [in] unused && lpszFile && LPTSTR && [in] Null-terminated string representing the full pathname of the file to open or create && dwMode && DWORD && [in] Indicates the type of access desired for the new file handle. |GENERIC_READ|An existing file is being opened for reading| |GENERIC_WRITE|An existing file is being opened or a new file is being created for writing| && dwFlagsAndAttr && DWORD && [in] Specifies the attributes to assign to a newly created file, and optional flags to control the behavior of the new file. This value is equivalent to the similar parameter in the Windows **CreateFile** function - see the Windows API SDK for information on these flags. && dwFlags && DWORD && [in] Combines the Windows API "creation disposition" parameter with several Opus-specific flags. |VFSCREATEF_RESUME|File is being opened to resume a transfer| |VFSCREATEF_RECURSIVECOPY|A recursive copy operation is in progress| |VFSCREATEF_THUMBNAIL|Opus is opening the file in order to generate a thumbnail| |VFSCREATEF_IGNOREIFSLOW|If reading the file will take a long time you should not open it and return failure instead| |VFSCREATEF_BUFFERED|The file is being buffered| && lpFT && LPFILETIME && [in] Unless set to NULL, this points to a **FILETIME** structure specifying the creation timestamp that is to be used for the newly created file. The **VFS_CreateFile** function is called to open or create a file in your plugin's namespace. You will only ever be called with **GENERIC_WRITE** if you do not specify the **VFSCAPABILITY_READONLY** capabilities flag. Directory Opus never opens a file for both read and write access - the //dwMode// parameter will always equal **GENERIC_READ** or **GENERIC_WRITE**. As well as the flags listed above for //dwFlags// this parameter also contains the Windows **CreateFile** "creation disposition" parameter - **CREATE_NEW**, **CREATE_ALWAYS**, etc. You can retrieve the creation disposition value using the special mask value **VFSCREATEF_MODEMASK**. If creation disposition value is not specified you should assume "create new" for a write operation and "open existing" for a read operation. In general, if your plugin does not support some of the concepts or features of this function you are free to ignore them - the only really important thing is that you return a **HANDLE** that can be passed to the [[vfs_readfile|VFS_ReadFile]], [[vfs_writefile|VFS_WriteFile]], [[vfs_seekfile|VFS_SeekFile]] and [[vfs_closefile|VFS_CloseFile]] functions.