[英]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.