Objective-C 程序设计(资料操作)
Objective-C 程序设计(文件操作)
常见的NSFileManger文件方法:
1.-(BOOL) contentsAtpath:path
从一个文件中读取数据
2.-(BOOL) createFileAtPath:path contents:(BOOL)data attributes:attr
向一个文件中写入数据
3.-(BOOL)removeFileAtPath:path handler;handler
删除一个文件
4.-(BOOL)movePath:from toPath:to handler:handler
重命名或者移动一个文件
5.-(BOOL)copyPath:from toPath:to handler:handler
比较这两个文件的内容
6.-(BOOL)fileExistsAtPath:path
测试文件是否存在
7.-(BOOL)isReadableFileAthPath:path
测试文件是否存在,并且是否能执行读操作
8.-(BOOL)isWritableFileAtPath:path
测试文件是否存在,并且是否能执行写操作
9.-(NSDictionary *)fileAttributesAtPath:path traverseLink:(BOOL)flag
获取文件的属性
10.-(BOOL)changeFileAttributes:attr atPath:path
更改文件属性
常见的NSFileManger文件方法:
1.-(BOOL) contentsAtpath:path
从一个文件中读取数据
2.-(BOOL) createFileAtPath:path contents:(BOOL)data attributes:attr
向一个文件中写入数据
3.-(BOOL)removeFileAtPath:path handler;handler
删除一个文件
4.-(BOOL)movePath:from toPath:to handler:handler
重命名或者移动一个文件
5.-(BOOL)copyPath:from toPath:to handler:handler
比较这两个文件的内容
6.-(BOOL)fileExistsAtPath:path
测试文件是否存在
7.-(BOOL)isReadableFileAthPath:path
测试文件是否存在,并且是否能执行读操作
8.-(BOOL)isWritableFileAtPath:path
测试文件是否存在,并且是否能执行写操作
9.-(NSDictionary *)fileAttributesAtPath:path traverseLink:(BOOL)flag
获取文件的属性
10.-(BOOL)changeFileAttributes:attr atPath:path
更改文件属性