2017-03-03 85 views
1

我想解析/var/log/jamf.log(逐行),同時有一個沙盒應用程序。訪問/var/log/jamf.log與沙箱

我的權利文件:

<dict> 
    <key>com.apple.security.app-sandbox</key> 
    <true/> 
    <key>com.apple.security.temporary-exception.files.absolute-path.read-write</key> 
    <array> 
     <string>/var/log/jamf.log</string> 
    </array> 
</dict> 

(我也試圖與.read只)

運行代碼:

do { 
    self.logFileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: "/var/log/jamf.log", isDirectory: false)) 
} catch { 
    dump(error) 
    self.logFileHandle = nil 
} 

有了這個,我得到以下錯誤:

Error Domain=NSCocoaErrorDomain Code=1 "(null)" UserInfo={NSFilePath=/var/log/jamf.log}

任何人是個想法?這可能是/對應於沙箱的根?

謝謝!

弗朗索瓦

回答

0

榮譽給Pepijn Bruienne:

的路徑需要/private/var/log/jamf.log/var/log是一個符號...