sta*_*fan 3 filesystems macos cocoa objective-c
我在NSString中有一个文件系统路径,但我需要一个FSRef用于我将要进行的系统调用.创建FSRef的最佳方法是什么?
试试FSPathMakeRef:
NSString *path = @"Some... path... here";
FSRef f;
OSStatus os_status = FSPathMakeRef((const UInt8 *)[path fileSystemRepresentation], &f, NULL);
if (os_status == noErr) {
NSLog(@"Success");
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2995 次 |
| 最近记录: |