Java 如何在temp中读取文件?
我有问题,如何读取临时文件和获取文件名Java 如何在temp中读取文件?,java,file,Java,File,我有问题,如何读取临时文件和获取文件名 tempFile = File.createTempFile("MyFile.txt", ".tmp" ); System.out.print("Created temporary file with name "); System.out.println(tempFile.getAbsolutePath()); 读取临时目录中的文件的方式与读取非临时文件的方式完全相同 getAbsolutePath返回文件的绝对路径名。如果按文件名仅引用路
tempFile = File.createTempFile("MyFile.txt", ".tmp" );
System.out.print("Created temporary file with name ");
System.out.println(tempFile.getAbsolutePath());
读取临时目录中的文件的方式与读取非临时文件的方式完全相同
getAbsolutePath返回文件的绝对路径名。如果按文件名仅引用路径名的文件部分,请使用getName方法
可能重复的