zoukankan      html  css  js  c++  java
  • NSFileManager创建文件夹

    NSFileManager*fileManager = [[NSFileManager alloc] init];

        NSString *pathDocuments = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];

        //缩略图路径

        createPath = [NSString stringWithFormat:@"%@/ThumbnailImage", pathDocuments];

        //原图路径

        createDir = [NSString stringWithFormat:@"%@/OriginalImage", pathDocuments];

        

        // 判断文件夹是否存在,如果不存在,则创建

        if (![[NSFileManager defaultManager] fileExistsAtPath:createPath]) {

            [fileManager createDirectoryAtPath:createPath withIntermediateDirectories:YES attributes:nil error:nil];

            [fileManager createDirectoryAtPath:createDir withIntermediateDirectories:YES attributes:nil error:nil];

        } else {

            NSLog(@"FileDir is exists.");

        }

  • 相关阅读:
    bzoj 2599
    bzoj 3697
    poj 1741
    bzoj 2741
    bzoj 5495
    bzoj 3261
    网络流24题——骑士共存问题 luogu 3355
    网络流24题——数字梯形问题 luogu 4013
    bzoj 3998
    网络流24题——魔术球问题 luogu 2765
  • 原文地址:https://www.cnblogs.com/liuting-1204/p/5606515.html
Copyright © 2011-2022 走看看