Bir bloğun yürütülme sayısını yalnızca kaydeden bir sayı tamsayı kullanarak bazı blok kapsamını kaydetmeye çalışıyorum. Bazı nedenlerden dolayı, oluşturduğum bazı dosyaları (örneğin, Eclipse'de yaptığım ve proje dizinine yerleştirdiğim "BlockForHelper.txt") yazmayı denediğimde, şu hatayı alıyorum:Android Hata - Open Failed ENOENT
java.io.FileNotFoundException: /nfs/guille/groce/users/nicholsk/workspace3/SQLTest/BlockForTest: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:416)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at com.example.sql2.SQLTest.blockCoverage(SQLTest.java:149)
at com.example.sql2.test.SQLTestCase.testSuite(SQLTestCase.java:41)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584)
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:400)
... 18 more
public void blockCoverage() throws IOException
{
String coverage = "";
for (int x = 0; x < 20; x++)
coverage += x + " " + bb_count[x] + "\n";
File file = new File("/nfs/guille/groce/users/nicholsk/workspace3/SQLTest/BlockForTest.txt");
Writer out = new OutputStreamWriter(new FileOutputStream(file)); // Here
try
{
out.write(coverage);
} finally {
out.close();
}
}
herkes bu neden olabileceğini biliyorum:
ve bana hata veriyor?
Bu txt dosyasını hangi eclipse klasörüne koydunuz? –
Sadece projemin kök dizini. Niye ya? – NioShobu
Bu problemi yaşadım. Programlı olarak oluşturulan klasörü sildim ve elle oluşturdum ve problemi çözdüm !!! – breceivemail