IOError: [Errno 13] Permission denied: 'D:/VMware/VMware Workstation/vmwarebase.dll' 的解決

今天準備在windows 10 上 安裝MAC的虛擬機,再執行unlocker.exe時,總是遇到如下錯誤:

 在網上找到了兩個解決方法,一個是說python的版本問題,一個說是python的路徑分隔符問題,結果兩個解決方法都不行。

於是找到了一個關於文件讀取的說明:

``r'' Open text file for reading. The stream is positioned at the beginning of the file.

``r+'' Open for reading and writing. The stream is positioned at the beginning of the file.

``w'' Truncate file to zero length or create text file for writing. The stream is positioned at the beginning of the file.

``w+'' Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file.

``a'' Open for writing. The file is created if it does not exist. The stream is positioned at the end of the file. Subsequent writes to the file will always end up at the then current end of file, irrespective of any intervening fseek(3) or similar.

``a+'' Open for reading and writing. The file is created if it does not exist. The stream is positioned at the end of the file. Subse- quent writes to the file will always end up at the then current end of file, irrespective of any intervening fseek(3) or similar.

From python documentation - http://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files:-

On Windows, 'b' appended to the mode opens the file in binary mode, so there are also modes like 'rb', 'wb', and 'r+b'. Python on Windows makes a distinction between text and binary files; the end-of-line characters in text files are automatically altered slightly when data is read or written. This behind-the-scenes modification to file data is fine for ASCII text files, but it’ll corrupt binary data like that in JPEG or EXE files. Be very careful to use binary mode when reading and writing such files. On Unix, it doesn’t hurt to append a 'b' to the mode, so you can use it platform-independently for all binary files.

找到unlocker.py的腳本中讀取文件的代碼:

發現這裏使用的是r+b,把r+b改爲r,再執行python unlocker.py,就可以了。

 

 

由於作者本人的github上刪除了unlocker的所有內容,最後,從https://github.com/BDisp/unlocker 找到了最新的版本,沒有發現腳本有類似問題。直接執行批處理文件,就可以了。

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章