NSFileManager(FileTest)


Extends Class: NSFileManager
Declared In: FileTest.h

Discussion

The FileTest category adds short methods that mimic the Unix shell file test operators like -x and -d. These methods are implemented with the default file manager, which is available as filem.

The access tests (test_r:, test_w:, and test_x:) use only standard Unix user and group ids. Access control lists are not considered.



Methods

-test_d:
-test_e:
-test_f:
-test_g:
-test_m:
-test_o:
-test_r:
-test_s:
-test_w:
-test_x:
-test_z:

test_d:


- (FSBoolean*) test_d:(NSString*)path; 
Discussion

Returns true if the path exists and is a directory.


test_e:


- (FSBoolean*) test_e:(NSString*)path;
Discussion

Returns true if the file path exists.


test_f:


- (FSBoolean*) test_f:(NSString*)path; 
Discussion

Returns true if the path exists and is a file.


test_g:


- (FSBoolean*) test_g:(NSString*)path; 
Discussion

Returns true if the file exists and owned by the current group.


test_m:


- (NSDate*) test_m:(NSString*)path; 
Discussion

Returns the modification date of the file, if it exists.


test_o:


- (FSBoolean*) test_o:(NSString*)path; 
Discussion

Returns true if the file exists and owned by the current user.


test_r:


- (FSBoolean*) test_r:(NSString*)path; 
Discussion

Returns true if the file exists and is readable by the current user.


test_s:


- (NSNumber*) test_s:(NSString*)path; 
Discussion

Returns the size in bytes of the file, if its exists.


test_w:


- (FSBoolean*) test_w:(NSString*)path; 
Discussion

Returns true if the file exists and is writeable by the current user.


test_x:


- (FSBoolean*) test_x:(NSString*)path; 
Discussion

Returns true if the file exists and is executable by the current user.


test_z:


- (FSBoolean*) test_z:(NSString*)path; 
Discussion

Returns true if the file exists and has non-zero size.

© Andrew Weinrich Last Updated: Wednesday, October 15, 2008