NSFileManager *manager=[NSFileManager defaultManager];
NSData *data=[NSData dataWithContentsOfFile:@"/Users/Amuxiaomu/Desktop/STUDY/代码练习/0411/a.txt"] ;
//1.
BOOL b=[manager createFileAtPath:@"/Users/Amuxiaomu/Desktop/STUDY/代码练习/0411/NSFileManager创建目录/2.txt" contents:data attributes:nil];
//2.withIntermediateDirectories 是否创建中间文件夹
b= [manager createDirectoryAtPath:@"/Users/Amuxiaomu/Desktop/STUDY/代码练习/0411/NSFileManager创建目录/txt/" withIntermediateDirectories:YES attributes:nil error:nil];
//3.
b =[manager copyItemAtPath:@"/Users/Amuxiaomu/Desktop/STUDY/代码练习/0411/NSFileManager创建目录/2.txt" toPath:@"/Users/Amuxiaomu/Desktop/STUDY/代码练习/0411/NSFileManager创建目录/txt/3.txt" error:nil];
//4.
b =[manager moveItemAtPath:@"/Users/Amuxiaomu/Desktop/STUDY/代码练习/0411/NSFileManager创建目录/2.txt" toPath:@"/Users/Amuxiaomu/Desktop/STUDY/代码练习/0411/NSFileManager创建目录/txt/4.txt" error:nil];
//5.moveItemAtPath 可以运用这个来进行文件的重命名
if (b) {
NSLog(@"创建成功");
}else{
NSLog(@"创建失败");
}