FileInputStream と ZipInputStream を使用して、jython で zip ファイルを開こうとしています。しかし、FileInputStream が呼び出されると、奇妙なことに FileNotFoundException が発生します。
これが私のコードです:
from java.lang import System
from java.io import ObjectInputStream, FileInputStream, BufferedInputStream
from java.util.zip import ZipInputStream, ZipEntry
file_input_stream = FileInputStream('C:\\Documents and Settings\\usr\\My Documents\\Downloads\\test.zip')
zip_input_stream = ZipInputStream(BufferedInputStream(file_input_stream))
entry = zip_input_stream.getNextEntry()
entry = zip_input_stream.getNextEntry()
object_input_stream = ObjectInputStream(zip_input_stream)
graph.model = object_input_stream.readObject()
object_input_stream.close()
zip_input_stream.close()
file_input_stream.close()
私のエラーは:
file_input_stream = FileInputStream('C:\\Documents and Settings\\usr\\My Documents\\Downloads\\test.zip')
Traceback (most recent call last):
File "<input>", line 1, in <module>
FileNotFoundException: java.io.FileNotFoundException: C:\Documents and Settings\usr\My Documents\Downloads\test.zip (The system cannot find the file specified)
ファイルが正しいディレクトリにあることは確かです。非zipファイルでFileInputStreamを呼び出すと、機能します。ここで何が間違っていますか?
ありがとう