#import <sys/xattr.h>

+ (NSString *)getFullFilePathInDocuments:(NSString *)subFilePath fileName:(NSString *)fileName
{
NSString *filePath = [NSString stringWithFormat:@"%@/Documents%@", NSHomeDirectory(), subFilePath];
// NSLog(@"function:%s,getFilePath %@", __FUNCTION__,filePath);
NSFileManager* fm = [NSFileManager defaultManager];
if ([fm fileExistsAtPath:filePath]) {
return [NSString stringWithFormat:@"%@/%@", filePath, fileName];
}
if ([fm createDirectoryAtPath:filePath
withIntermediateDirectories:YES
attributes:nil
error:nil])
{
u_int8_t b = 1;
setxattr([filePath fileSystemRepresentation], "com.apple.MobileBackup", &b, 1, 0, 0);
return [NSString stringWithFormat:@"%@/%@", filePath, fileName];
}
return nil;
}

self.mFile = [MagicEntity getFullFilePathInDocuments:@"/test" fileName:@"yuv.bin"];

NSData *data = [[NSData alloc] initWithBytes:I420 length:w * h * 3 / 2];
bool r = [data writeToFile:self.mFile atomically:true];

IOS Intro - Write file的更多相关文章

  1. 【ZBar】ios错误ignoring file xxx missing required architecture x86_64 in file

    解决方法: 1.在Project target里"Architectures"设置为:Standard (armv7,armv7s)或者  Standard (armv7,arm6 ...

  2. IOS Intro - Property Synthesis

    http://www.thecodecrate.com/ios/objective-c/objective-c-property-synthesize/ 01. atomic              ...

  3. iOS - 文件操作(File Operating)

    1. 沙盒 & NSData /*_______________________________获取沙盒路径_________________________________________* ...

  4. IOS Intro - UIWindow UIView and CALayer

    UIWindow.UIView以及CALayer之间的关系2016-05-11 20:46 本站整理 浏览(16) UIWindow1.简介UIWindow是一种特殊的UIView,通常在一个app中 ...

  5. ios错误ignoring file xxx missing required architecture x86_64 in file

    错误ignoring file xxx missing required architecture x86_64 in file 解决方法: 1.在Project target里“Architectu ...

  6. iOS之input file调用相册控制器消失跳转到登陆页

    最近在做一个app要用到H5,其中有一个需求是要点击H5的的控件弹出系统相册,通过在H5的input file 中定义<input type="file" class=&qu ...

  7. iOS-PCH File的快速导入方法和使用

    PCH的文件的用途:      在实际的项目开发中,如果很多地方都在使用某个类的头文件,很多地方都在使用同一个”宏”的时候:很多地方用到了NSLog()函数, 在app发布的时候,想清除掉时,此时就需 ...

  8. IOS Intro - NSDictionary and NSMutableDictionary

    NSDictionary.NSMutableDictionary的基本用法 1.不可变词典NSDictionary 字典初始化 NSNumber *numObj = [NSNumber numberW ...

  9. react-native IOS Build input file cannot be found: '~~~~~/node_modules/react-native/Libraries/WebSocket/libfishhook.a'

    尝试添加或者删除libfishhook.a 如果解决了你的问题请点个赞!

随机推荐

  1. Fiddldr 教程之:HTTP协议详解(转)

    原文地址:http://www.cnblogs.com/TankXiao/archive/2012/02/13/2342672.html HTTP协议详解 当今web程序的开发技术真是百家争鸣,ASP ...

  2. SpringMVC错误集中营

    1.eclipse里的错误提示为The import javax.servlet.http.HttpServletRequest cannot be resolved 1.这是因为工程里面web-in ...

  3. linux 不在sudoers文件中、普通用户获得sudo权限

    现在要让jack用户获得sudo使用权 切换到超级用户root $su root 查看/etc/sudoers权限,可以看到当前权限为440 $ ls -all /etc/sudoers -r--r- ...

  4. HttpUploader6-queue版本更新说明

    HttpUploader6-queue版本更新说明 博客园:http://www.cnblogs.com/xproer/p/5109761.html 网易博客:http://hyhyo.blog.16 ...

  5. sublime Text2常见插件介绍

    zen coding 一种快速编写HTML/CSS代码的方法,已改名为Emmet,并且搭建了一个新的网站:docs.emmet.io Sublime Text 2安装插件Emmet后,打开sublim ...

  6. elasticsearch常用JAVA API 实例

    1.引入dependency <dependency> <groupId>org.springframework.data</groupId> <artifa ...

  7. 新入门PGSQL数据库(尝试利用PGPOOL实现分布式),摘录笔记

    概念: PostgreSQL (pronounced "post-gress-Q-L") is an open source relational database managem ...

  8. MacOS安装使用Node.js

    1. 到官网https://nodejs.org/zh-cn/download/下载,选择Macintosh Installer, 如下: 2. 按预设的下一步,Node.js版本为v6.10.0, ...

  9. 安装MySQL提示:应用程序无法正常启动(0xc000007b)

    转:https://blog.csdn.net/zztingfeng/article/details/80155624 解决:在百度上下载DirectX修复工具(增强版),修复即可. 链接:http: ...

  10. js webstrom中svn的配置及使用

    js  webstorm中svn的配置及使用 一.webstorm配置svn: 1.在webstorm工具中找到file(文件)-setting(设置)菜单按钮: 2.在左边菜单中找到plus(插件) ...