331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
[pool release];
}
+ (void)renameFileAtPath: (OFString*)from
toPath: (OFString*)to
{
#ifndef _WIN32
if (rename([from cString], [to cString]))
#else
if (!MoveFile([from cString], [to cString]))
#endif
@throw [OFRenameFileFailedException newWithClass: self
sourcePath: from
|
>
>
>
>
>
|
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
|
[pool release];
}
+ (void)renameFileAtPath: (OFString*)from
toPath: (OFString*)to
{
if ([self directoryExistsAtPath: to]) {
OFString *filename = [self lastComponentOfPath: from];
to = [OFString stringWithPath: to, filename, nil];
}
#ifndef _WIN32
if (rename([from cString], [to cString]))
#else
if (!MoveFile([from cString], [to cString]))
#endif
@throw [OFRenameFileFailedException newWithClass: self
sourcePath: from
|
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
|
path: path];
}
#ifndef _WIN32
+ (void)linkFileAtPath: (OFString*)src
toPath: (OFString*)dest
{
if (link([src cString], [dest cString]) != 0)
@throw [OFLinkFailedException newWithClass: self
sourcePath: src
destinationPath: dest];
}
+ (void)symlinkFileAtPath: (OFString*)src
toPath: (OFString*)dest
{
if (symlink([src cString], [dest cString]) != 0)
@throw [OFSymlinkFailedException newWithClass: self
sourcePath: src
destinationPath: dest];
}
#endif
|
>
>
>
>
>
>
>
>
>
>
|
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
|
path: path];
}
#ifndef _WIN32
+ (void)linkFileAtPath: (OFString*)src
toPath: (OFString*)dest
{
if ([self directoryExistsAtPath: dest]) {
OFString *filename = [self lastComponentOfPath: src];
dest = [OFString stringWithPath: dest, filename, nil];
}
if (link([src cString], [dest cString]) != 0)
@throw [OFLinkFailedException newWithClass: self
sourcePath: src
destinationPath: dest];
}
+ (void)symlinkFileAtPath: (OFString*)src
toPath: (OFString*)dest
{
if ([self directoryExistsAtPath: dest]) {
OFString *filename = [self lastComponentOfPath: src];
dest = [OFString stringWithPath: dest, filename, nil];
}
if (symlink([src cString], [dest cString]) != 0)
@throw [OFSymlinkFailedException newWithClass: self
sourcePath: src
destinationPath: dest];
}
#endif
|