注册 登录
编程论坛 Mac OS X

mac下开放个app,为什么fopen打不开文件那,是什么原因那?

qq871852072 发布于 2020-09-29 11:18, 1552 次点击
FILE *srcFile = fopen(binaryPath, "r");
        if (srcFile == NULL)
        {
            int errNum = 0;
            errNum = errno;
            printf("open fail errno = %d reason = %s \n", errNum, strerror(errNum));
            fprintf(stderr, "Error: Could not open binary %s\n", binaryPath);
            exit(1);
        }
显示结果是
open fail errno = 1 reason = Operation not permitted
Error: Could not open binary /Users/sorke/Library/Developer/Xcode/DerivedData/testOpen-bubwyliyuporlthhugwnbxxxdhph/Build/Products/Debug-iphoneos/testDynamic.dylib
0 回复
1