368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
@throw [OFChangeFileModeFailedException
exceptionWithClass: self
path: path
mode: mode];
# endif
}
#endif
+ (OFDate*)modificationDateOfFile: (OFString*)path
{
struct stat s;
if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE],
&s) == -1)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
|
@throw [OFChangeFileModeFailedException
exceptionWithClass: self
path: path
mode: mode];
# endif
}
#endif
+ (off_t)sizeOfFile: (OFString*)path
{
struct stat s;
if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE],
&s) == -1)
/* FIXME: Maybe use another exception? */
@throw [OFOpenFileFailedException exceptionWithClass: self
path: path
mode: @"r"];
return s.st_size;
}
+ (OFDate*)modificationDateOfFile: (OFString*)path
{
struct stat s;
if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE],
&s) == -1)
|