311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
#else
char *zMbcs = fossil_utf8_to_filename(zFilename);
int rc = access(zMbcs, flags);
#endif
fossil_filename_free(zMbcs);
return rc;
}
/*
** Find an unused filename similar to zBase with zSuffix appended.
**
** Make the name relative to the working directory if relFlag is true.
**
** Space to hold the new filename is obtained form mprintf() and should
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
#else
char *zMbcs = fossil_utf8_to_filename(zFilename);
int rc = access(zMbcs, flags);
#endif
fossil_filename_free(zMbcs);
return rc;
}
/*
** Wrapper around the chdir() system call.
** If bChroot=1, do a chroot to this dir as well
** (UNIX only)
*/
int file_chdir(const char *zChDir, int bChroot){
#ifdef _WIN32
wchar_t *zPath = fossil_utf8_to_filename(zChDir);
int rc = _wchdir(zPath);
#else
char *zPath = fossil_utf8_to_filename(zChDir);
int rc = chdir(zPath);
if( !rc && bChroot ){
rc = chroot(zPath);
if( !rc ) rc = chdir("/");
}
#endif
fossil_filename_free(zPath);
return rc;
}
/*
** Find an unused filename similar to zBase with zSuffix appended.
**
** Make the name relative to the working directory if relFlag is true.
**
** Space to hold the new filename is obtained form mprintf() and should
|