[英]How to read from file in temp?
我有问题,如何在temp中读取文件并获取文件名?
tempFile = File.createTempFile("MyFile.txt", ".tmp" );
System.out.print("Created temporary file with name ");
System.out.println(tempFile.getAbsolutePath());
读取临时目录中的文件的方式与读取非临时文件的方式完全相同。
getAbsolutePath()
返回文件的绝对路径名。 如果通过“文件名”仅引用路径名的“文件”部分,请使用getName()
方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.