| ︙ | | | ︙ | |
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
|
int
Tcl_FSUtime(
Tcl_Obj *pathPtr, /* Pathaname of file to call uTimeProc on */
struct utimbuf *tval) /* Specifies the access/modification
* times to use. Should not be modified. */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr != NULL && fsPtr->utimeProc != NULL) {
return fsPtr->utimeProc(pathPtr, tval);
}
/* TODO: set errno here? Tcl_SetErrno(ENOENT); */
return -1;
}
/*
*----------------------------------------------------------------------
*
* NativeFileAttrStrings --
|
>
>
>
>
|
|
|
>
>
|
|
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
|
int
Tcl_FSUtime(
Tcl_Obj *pathPtr, /* Pathaname of file to call uTimeProc on */
struct utimbuf *tval) /* Specifies the access/modification
* times to use. Should not be modified. */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
int err;
if (fsPtr == NULL) {
err = ENOENT;
} else {
if (fsPtr->utimeProc != NULL) {
return fsPtr->utimeProc(pathPtr, tval);
}
err = ENOTSUP;
}
Tcl_SetErrno(err);
return -1;
}
/*
*----------------------------------------------------------------------
*
* NativeFileAttrStrings --
|
| ︙ | | | ︙ | |
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
|
Tcl_Obj *toPtr, /*
* NULL or the pathname of a file to link to.
*/
int linkAction) /* Action to perform. */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr != NULL && fsPtr->linkProc != NULL) {
return fsPtr->linkProc(pathPtr, toPtr, linkAction);
}
/*
* If S_IFLNK isn't defined the machine doesn't support symbolic links, so
* the file can't possibly be a symbolic link. Generate an EINVAL error,
* which is what happens on machines that do support symbolic links when
* readlink is called for a file that isn't a symbolic link.
|
|
>
>
>
>
|
>
|
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
|
Tcl_Obj *toPtr, /*
* NULL or the pathname of a file to link to.
*/
int linkAction) /* Action to perform. */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr) {
if (fsPtr->linkProc == NULL) {
Tcl_SetErrno(ENOTSUP);
return NULL;
} else {
return fsPtr->linkProc(pathPtr, toPtr, linkAction);
}
}
/*
* If S_IFLNK isn't defined the machine doesn't support symbolic links, so
* the file can't possibly be a symbolic link. Generate an EINVAL error,
* which is what happens on machines that do support symbolic links when
* readlink is called for a file that isn't a symbolic link.
|
| ︙ | | | ︙ | |
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
|
*/
int
Tcl_FSDeleteFile(
Tcl_Obj *pathPtr) /* Pathname of file to be removed (UTF-8). */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr != NULL && fsPtr->deleteFileProc != NULL) {
return fsPtr->deleteFileProc(pathPtr);
}
Tcl_SetErrno(ENOENT);
return -1;
}
/*
*---------------------------------------------------------------------------
*
* Tcl_FSCreateDirectory --
|
>
|
>
>
>
|
|
|
>
>
|
|
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
|
*/
int
Tcl_FSDeleteFile(
Tcl_Obj *pathPtr) /* Pathname of file to be removed (UTF-8). */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
int err;
if (fsPtr == NULL) {
err = ENOENT;
} else {
if (fsPtr->deleteFileProc != NULL) {
return fsPtr->deleteFileProc(pathPtr);
}
err = ENOTSUP;
}
Tcl_SetErrno(err);
return -1;
}
/*
*---------------------------------------------------------------------------
*
* Tcl_FSCreateDirectory --
|
| ︙ | | | ︙ | |
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
|
*/
int
Tcl_FSCreateDirectory(
Tcl_Obj *pathPtr) /* Pathname of directory to create (UTF-8). */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr != NULL && fsPtr->createDirectoryProc != NULL) {
return fsPtr->createDirectoryProc(pathPtr);
}
Tcl_SetErrno(ENOENT);
return -1;
}
/*
*---------------------------------------------------------------------------
*
* Tcl_FSCopyDirectory --
|
>
>
>
>
|
|
|
>
>
|
|
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
|
*/
int
Tcl_FSCreateDirectory(
Tcl_Obj *pathPtr) /* Pathname of directory to create (UTF-8). */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
int err;
if (fsPtr == NULL) {
err = ENOENT;
} else {
if (fsPtr->createDirectoryProc != NULL) {
return fsPtr->createDirectoryProc(pathPtr);
}
err = ENOTSUP;
}
Tcl_SetErrno(err);
return -1;
}
/*
*---------------------------------------------------------------------------
*
* Tcl_FSCopyDirectory --
|
| ︙ | | | ︙ | |
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
|
* place to store a a pointer to a new
* object having a refCount of 1 and containing
* the name of the file that produced an error.
* */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr == NULL || fsPtr->removeDirectoryProc == NULL) {
Tcl_SetErrno(ENOENT);
return -1;
}
if (recursive) {
Tcl_Obj *cwdPtr = Tcl_FSGetCwd(NULL);
if (cwdPtr != NULL) {
const char *cwdStr, *normPathStr;
Tcl_Size cwdLen, normLen;
|
|
>
>
>
>
|
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
|
* place to store a a pointer to a new
* object having a refCount of 1 and containing
* the name of the file that produced an error.
* */
{
const Tcl_Filesystem *fsPtr = Tcl_FSGetFileSystemForPath(pathPtr);
if (fsPtr == NULL) {
Tcl_SetErrno(ENOENT);
return -1;
}
if (fsPtr->removeDirectoryProc == NULL) {
Tcl_SetErrno(ENOTSUP);
return -1;
}
if (recursive) {
Tcl_Obj *cwdPtr = Tcl_FSGetCwd(NULL);
if (cwdPtr != NULL) {
const char *cwdStr, *normPathStr;
Tcl_Size cwdLen, normLen;
|
| ︙ | | | ︙ | |