मुझे वर्तमान में समस्या है कि मुझे एक अपवाद का सामना करना पड़ा जो मैंने पहले कभी नहीं देखा था और इसलिए मुझे नहीं पता कि इसे कैसे संभालना है।java.io.Exception से java.io.WinNTFileSystem.createFileExclusively पर छुटकारा पाने के लिए गर्म?
मैं दिए गए पैरामीटर के अनुसार एक फाइल बनाना चाहता हूं, लेकिन यह काम नहीं करेगा।
public static Path createFile(String destDir, String fileName) throws IOException {
FileAccess.createDirectory(destDir);
Path xpath = new Path(destDir + Path.SEPARATOR + fileName);
if (! xpath.toFile().exists()) {
xpath.toFile().createNewFile();
if(FileAccess.TRACE_FILE)Trace.println1("<<< createFile " + xpath.toString());
}
return xpath;
}
public static void createDirectory(String destDir) {
Path dirpath = new Path(destDir);
if (! dirpath.toFile().exists()) {
dirpath.toFile().mkdir();
if(TRACE_FILE)Trace.println1("<<< mkdir " + dirpath.toString());
}
}
हर बार जब मैं अपने एप्लिकेशन को चलाने के निम्नलिखित अपवाद तब होता है:
java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
[...]
मैं इसे कैसे से छुटकारा मिलता है? (मैं Win7 64 बिट बीटीडब्ल्यू का उपयोग कर रहा हूं)
धन्यवाद, _new फ़ाइल (destDir)। Mkdirs(); _ समाधान काम किया! – keinabel
आपका स्वागत है। – JTeagle