标签:ios
- (void)createFileDirectories
{
// 判断存放音频、视频的文件夹是否存在,不存在则创建对应文件夹
NSFileManager *fileManager = [NSFileManagerdefaultManager];
BOOL isDir = FALSE;
BOOL isDirExist = [fileManager fileExistsAtPath:DOCUMENTS_FOLDER_AUDIOisDirectory:&isDir];
if(!(isDirExist && isDir))
{
BOOL bCreateDir = [fileManager createDirectoryAtPath:DOCUMENTS_FOLDER_AUDIOwithIntermediateDirectories:YESattributes:nilerror:nil];
if(!bCreateDir){
NSLog(@"Create Audio Directory Failed.");
}
NSLog(@"%@",DOCUMENTS_FOLDER_AUDIO);
}
isDir = FALSE;
isDirExist = [fileManager fileExistsAtPath:DOCUMENTS_FOLDER_VEDIOisDirectory:&isDir];
if(!(isDirExist && isDir)){
BOOL bCreateDir = [fileManager createDirectoryAtPath:DOCUMENTS_FOLDER_VEDIOwithIntermediateDirectories:YESattributes:nilerror:nil];
if(!bCreateDir){
NSLog(@"Create Audio Directory Failed.");
}
NSLog(@"%@",DOCUMENTS_FOLDER_VEDIO);
}
}
标签:ios
原文地址:http://blog.csdn.net/longshiqing14/article/details/45242759