70
93
FILEMACOS_UNMOUNT_ERROR,
71
94
} FileMacosUnmountStatus;
73
EXTERN FileMacosUnmountStatus FileMacos_UnmountDev(char const *bsdDev,
78
EXTERN void FileMacos_MountDevAsyncNoResult(char const *bsdDev,
96
FileMacosUnmountStatus FileMacos_UnmountDev(char const *bsdDev,
81
EXTERN Bool FileMacos_IsOnExternalDevice(int fd);
82
EXTERN Bool FileMacos_IsOnSparseDmg(int fd);
83
EXTERN Bool FileMacos_IsSliceDevice(char const *bsdDev);
85
EXTERN char *FileMacos_DiskDevToUserFriendlyName(char const *bsdDiskDev);
87
EXTERN char *FileMacos_DiskDeviceToUniqueID(char const *bsdPath);
88
EXTERN char *FileMacos_UniqueIDToDiskDevice(char const *identifier);
101
void FileMacos_MountDevAsyncNoResult(char const *bsdDev,
104
Bool FileMacos_IsOnExternalDevice(int fd);
105
Bool FileMacos_IsOnSparseDmg(int fd);
106
Bool FileMacos_IsSliceDevice(char const *bsdDev);
108
char *FileMacos_DiskDevToUserFriendlyName(char const *bsdDiskDev);
110
char *FileMacos_DiskDeviceToUniqueID(char const *bsdPath);
111
char *FileMacos_UniqueIDToDiskDevice(char const *identifier);
89
113
#elif defined VMX86_SERVER
90
EXTERN int File_GetVMFSBlockSize(ConstUnicode pathName, uint32 *blockSize);
91
EXTERN int File_GetVMFSMountInfo(ConstUnicode pathName,
95
char **remoteMountPoint,
96
char **localMountPoint);
114
int File_GetVMFSVersion(ConstUnicode pathName,
116
int File_GetVMFSBlockSize(ConstUnicode pathName,
119
int File_GetVMFSMountInfo(ConstUnicode pathName,
123
char **remoteMountPoint,
124
char **localMountPoint);
99
EXTERN Bool File_SupportsZeroedThick(ConstUnicode pathName);
101
EXTERN Bool File_Exists(ConstUnicode pathName);
103
EXTERN int File_Unlink(ConstUnicode pathName);
105
EXTERN int File_UnlinkIfExists(ConstUnicode pathName);
107
EXTERN int File_UnlinkDelayed(ConstUnicode pathName);
109
EXTERN int File_UnlinkNoFollow(ConstUnicode pathName);
111
EXTERN void File_SplitName(ConstUnicode pathName,
116
EXTERN void File_GetPathName(ConstUnicode fullPath,
120
EXTERN Unicode File_StripSlashes(ConstUnicode path);
122
EXTERN Unicode File_PathJoin(ConstUnicode dirName,
123
ConstUnicode baseName);
125
EXTERN Bool File_CreateDirectory(ConstUnicode pathName);
126
EXTERN Bool File_EnsureDirectory(ConstUnicode pathName);
128
EXTERN Bool File_DeleteEmptyDirectory(ConstUnicode pathName);
130
EXTERN Bool File_CreateDirectoryHierarchy(ConstUnicode pathName);
132
EXTERN Bool File_DeleteDirectoryTree(ConstUnicode pathName);
134
EXTERN int File_ListDirectory(ConstUnicode pathName,
127
Bool File_SupportsZeroedThick(ConstUnicode pathName);
129
Bool File_SupportsMultiWriter(ConstUnicode pathName);
131
Bool File_Exists(ConstUnicode pathName);
133
int File_Unlink(ConstUnicode pathName);
135
int File_UnlinkIfExists(ConstUnicode pathName);
137
int File_UnlinkDelayed(ConstUnicode pathName);
139
int File_UnlinkNoFollow(ConstUnicode pathName);
141
void File_SplitName(ConstUnicode pathName,
146
void File_GetPathName(ConstUnicode fullPath,
150
Unicode File_StripSlashes(ConstUnicode path);
152
Unicode File_PathJoin(ConstUnicode dirName,
153
ConstUnicode baseName);
155
Bool File_CreateDirectory(ConstUnicode pathName);
156
Bool File_EnsureDirectory(ConstUnicode pathName);
158
Bool File_DeleteEmptyDirectory(ConstUnicode pathName);
160
Bool File_CreateDirectoryHierarchy(ConstUnicode pathName);
162
Bool File_DeleteDirectoryTree(ConstUnicode pathName);
164
int File_ListDirectory(ConstUnicode pathName,
138
168
* Simple file-system walk.
141
EXTERN WalkDirContext File_WalkDirectoryStart(ConstUnicode parentPath);
142
EXTERN Bool File_WalkDirectoryNext(WalkDirContext context,
144
EXTERN void File_WalkDirectoryEnd(WalkDirContext context);
146
EXTERN Bool File_IsDirectory(ConstUnicode pathName);
148
EXTERN Bool File_IsFile(ConstUnicode pathName);
150
EXTERN Bool File_IsSymLink(ConstUnicode fileName);
152
EXTERN Bool File_IsCharDevice(ConstUnicode pathName);
154
EXTERN Bool File_IsRemote(ConstUnicode pathName);
156
EXTERN Bool File_IsEmptyDirectory(ConstUnicode pathName);
158
EXTERN Unicode File_Cwd(ConstUnicode drive); // XXX belongs to `process' module
160
EXTERN Unicode File_FullPath(ConstUnicode pathName);
162
EXTERN Bool File_IsFullPath(ConstUnicode pathName);
164
EXTERN uint64 File_GetFreeSpace(ConstUnicode pathName,
167
EXTERN uint64 File_GetCapacity(ConstUnicode pathName);
171
WalkDirContext File_WalkDirectoryStart(ConstUnicode parentPath);
173
Bool File_WalkDirectoryNext(WalkDirContext context,
176
void File_WalkDirectoryEnd(WalkDirContext context);
178
Bool File_IsDirectory(ConstUnicode pathName);
180
Bool File_IsFile(ConstUnicode pathName);
182
Bool File_IsSymLink(ConstUnicode fileName);
184
Bool File_IsCharDevice(ConstUnicode pathName);
186
Bool File_IsRemote(ConstUnicode pathName);
188
Bool File_IsEmptyDirectory(ConstUnicode pathName);
190
Unicode File_Cwd(ConstUnicode drive); // XXX belongs to `process' module
192
Unicode File_FullPath(ConstUnicode pathName);
194
Bool File_IsFullPath(ConstUnicode pathName);
196
uint64 File_GetFreeSpace(ConstUnicode pathName,
199
uint64 File_GetCapacity(ConstUnicode pathName);
169
201
/* Deprecated; use Util_GetSafeTmpDir if you can */
170
EXTERN char *File_GetTmpDir(Bool useConf);
202
char *File_GetTmpDir(Bool useConf);
172
204
/* Deprecated; use Util_MakeSafeTemp if you can */
173
EXTERN int File_MakeTemp(ConstUnicode tag,
176
EXTERN int File_MakeTempEx(ConstUnicode dir,
177
ConstUnicode fileName,
180
EXTERN int64 File_GetModTime(ConstUnicode pathName);
182
EXTERN char *File_GetModTimeString(ConstUnicode pathName);
184
EXTERN char *File_GetUniqueFileSystemID(const char *fileName);
186
EXTERN Bool File_GetTimes(ConstUnicode pathName,
187
VmTimeType *createTime,
188
VmTimeType *accessTime,
189
VmTimeType *writeTime,
190
VmTimeType *attrChangeTime);
192
EXTERN Bool File_SetTimes(ConstUnicode pathName,
193
VmTimeType createTime,
194
VmTimeType accessTime,
195
VmTimeType writeTime,
196
VmTimeType attrChangeTime);
198
EXTERN Bool File_GetFilePermissions(ConstUnicode pathName,
201
EXTERN Bool File_SetFilePermissions(ConstUnicode pathName,
204
EXTERN Bool File_SupportsFileSize(ConstUnicode pathName,
207
EXTERN Bool File_SupportsLargeFiles(ConstUnicode pathName);
209
EXTERN char *File_MapPathPrefix(const char *oldPath,
210
const char **oldPrefixes,
211
const char **newPrefixes,
214
EXTERN Bool File_CopyFromFdToFd(FileIODescriptor src,
215
FileIODescriptor dst);
217
EXTERN FileIOResult File_CreatePrompt(FileIODescriptor *file,
218
ConstUnicode pathName,
222
EXTERN Bool File_CopyFromFd(FileIODescriptor src,
223
ConstUnicode dstName,
224
Bool overwriteExisting);
226
EXTERN Bool File_Copy(ConstUnicode srcName,
227
ConstUnicode dstName,
228
Bool overwriteExisting);
230
EXTERN Bool File_CopyFromFdToName(FileIODescriptor src,
231
ConstUnicode dstName,
234
EXTERN Bool File_CopyFromNameToName(ConstUnicode srcName,
235
ConstUnicode dstName,
238
EXTERN Bool File_Replace(ConstUnicode oldFile,
239
ConstUnicode newFile);
241
EXTERN Bool File_Rename(ConstUnicode oldFile,
242
ConstUnicode newFile);
244
EXTERN int64 File_GetSize(ConstUnicode pathName);
246
EXTERN int64 File_GetSizeByPath(ConstUnicode pathName);
248
EXTERN int64 File_GetSizeAlternate(ConstUnicode pathName);
205
int File_MakeTemp(ConstUnicode tag,
208
int File_MakeTempEx(ConstUnicode dir,
209
ConstUnicode fileName,
212
int File_MakeTempEx2(ConstUnicode dir,
214
File_MakeTempCreateNameFunc *createNameFunc,
215
void *createFuncData,
218
int64 File_GetModTime(ConstUnicode pathName);
220
char *File_GetModTimeString(ConstUnicode pathName);
222
char *File_GetUniqueFileSystemID(const char *fileName);
224
Bool File_GetTimes(ConstUnicode pathName,
225
VmTimeType *createTime,
226
VmTimeType *accessTime,
227
VmTimeType *writeTime,
228
VmTimeType *attrChangeTime);
230
Bool File_SetTimes(ConstUnicode pathName,
231
VmTimeType createTime,
232
VmTimeType accessTime,
233
VmTimeType writeTime,
234
VmTimeType attrChangeTime);
236
Bool File_GetFilePermissions(ConstUnicode pathName,
239
Bool File_SetFilePermissions(ConstUnicode pathName,
242
Bool File_SupportsFileSize(ConstUnicode pathName,
245
Bool File_SupportsLargeFiles(ConstUnicode pathName);
247
char *File_MapPathPrefix(const char *oldPath,
248
const char **oldPrefixes,
249
const char **newPrefixes,
252
Bool File_CopyFromFdToFd(FileIODescriptor src,
253
FileIODescriptor dst);
255
FileIOResult File_CreatePrompt(FileIODescriptor *file,
256
ConstUnicode pathName,
260
Bool File_CopyFromFd(FileIODescriptor src,
261
ConstUnicode dstName,
262
Bool overwriteExisting);
264
Bool File_Copy(ConstUnicode srcName,
265
ConstUnicode dstName,
266
Bool overwriteExisting);
268
Bool File_CopyFromFdToName(FileIODescriptor src,
269
ConstUnicode dstName,
272
Bool File_CopyFromNameToName(ConstUnicode srcName,
273
ConstUnicode dstName,
276
Bool File_CopyTree(ConstUnicode srcName,
277
ConstUnicode dstName,
278
Bool overwriteExisting,
279
Bool followSymlinks);
281
Bool File_Replace(ConstUnicode oldFile,
282
ConstUnicode newFile);
284
Bool File_Move(ConstUnicode oldFile,
285
ConstUnicode newFile,
288
void File_Rotate(const char *fileName,
293
/* Get size only for regular file. */
294
int64 File_GetSize(ConstUnicode pathName);
296
/* Get size for file or directory. */
297
int64 File_GetSizeEx(ConstUnicode pathName);
299
int64 File_GetSizeByPath(ConstUnicode pathName);
301
int64 File_GetSizeAlternate(ConstUnicode pathName);
250
303
/* file change notification module */
251
304
typedef void (*CbFunction)(void *clientData);
253
typedef void (*NotifyCallback)(ConstUnicode pathName,
306
typedef void (*NotifyCallback)(ConstUnicode pathName,
257
310
typedef void (*PollTimeout) (CbFunction f,
261
314
typedef void (*PollRemoveTimeout) (CbFunction f,
262
315
void *clientData);
264
EXTERN void File_PollInit(PollTimeout pt,
265
PollRemoveTimeout prt);
267
EXTERN void File_PollExit(void);
269
EXTERN void File_PollImpersonateOnCheck(Bool check);
271
EXTERN Bool File_PollAddFile(ConstUnicode pathName,
273
NotifyCallback callback,
277
EXTERN Bool File_PollAddDirFile(ConstUnicode pathName,
279
NotifyCallback callback,
283
EXTERN Bool File_PollRemoveFile(ConstUnicode pathName,
285
NotifyCallback callback);
287
EXTERN Bool File_IsSameFile(ConstUnicode path1,
290
EXTERN char *File_PrependToPath(const char *searchPath,
293
EXTERN Bool File_FindFileInSearchPath(const char *file,
294
const char *searchPath,
298
EXTERN Unicode File_ReplaceExtension(ConstUnicode pathName,
299
ConstUnicode newExtension,
300
uint32 numExtensions,
303
EXTERN Bool File_MakeCfgFileExecutable(ConstUnicode pathName);
305
EXTERN char *File_ExpandAndCheckDir(const char *dirName);
317
void File_PollInit(PollTimeout pt,
318
PollRemoveTimeout prt);
320
void File_PollExit(void);
322
void File_PollImpersonateOnCheck(Bool check);
324
Bool File_PollAddFile(ConstUnicode pathName,
326
NotifyCallback callback,
330
Bool File_PollAddDirFile(ConstUnicode pathName,
332
NotifyCallback callback,
336
Bool File_PollRemoveFile(ConstUnicode pathName,
338
NotifyCallback callback);
340
Bool File_IsSameFile(ConstUnicode path1,
343
char *File_PrependToPath(const char *searchPath,
346
Bool File_FindFileInSearchPath(const char *file,
347
const char *searchPath,
351
Unicode File_ReplaceExtension(ConstUnicode pathName,
352
ConstUnicode newExtension,
353
uint32 numExtensions,
356
Unicode File_RemoveExtension(ConstUnicode pathName);
358
Bool File_MakeCfgFileExecutable(ConstUnicode pathName);
360
char *File_ExpandAndCheckDir(const char *dirName);
307
362
#ifdef __cplusplus
308
363
} // extern "C" {