In iOS, Apple has encapsulated a class and opened the corresponding IPA. The corresponding class is nsfilemanager and the file management class.
Instantiation:
Nsfilemanager * manage = [nsfilemanager defaultmanager];
Create a file directory
[Manage createdirectoryatpath: direcatorypath withintermediatedirectories: Yes attributes: Nil error: Nil];
Returns the bool type and determines whether the bool type is successfully created.
If you write data to a file, such as nsdata, you can:
Bool iswrite = [_ DATA writetofile: filepath atomically: Yes];
Returns the result and determines whether the operation is successful.
Copy an object:
-(Bool) copyitematpath :( nsstring *) srcpath topath :( nsstring *) dstpath error :( nserror **) Error ns_available (10_5, 2_0 );
Transfer:
-(Bool) moveitematpath :( nsstring *) srcpath topath :( nsstring *) dstpath error :( nserror **) Error ns_available (10_5, 2_0 );
Delete:
-(Bool) removeitematpath :( nsstring *) path error :( nserror **) Error ns_available (10_5, 2_0 );
Whether the file exists:
-(Bool) fileexistsatpath :( nsstring *) path;
Whether the file can be read:
-(Bool) isreadablefileatpath :( nsstring *) path;
.... , A series of common uses.