[英]How do I get getpwuid to work in my mac app?
我正在嘗試讓沙盒Mac應用程序進入用戶的真實主文件夾。
這就是我嘗試過的
const char *home = getpwent()->pw_dir;
NSString *path = [[NSFileManager defaultManager]
stringWithFileSystemRepresentation:home
length:strlen(home)];
NSURL *url = [NSURL fileURLWithPath:path isDirectory:YES];
但我收到此錯誤:
Member reference type 'int' is not a pointer
我想念什么?
我忘了
#include <pwd.h>
如果其他人遇到問題,我將保留該問題!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.