Android错误 - 打开失败的ENOENT(Android Error - Open Failed ENOENT)
我正在尝试使用一个整数数组来保存一些块覆盖,这个数组只需保存执行一个块的次数。 由于某种原因,当我尝试写一些我创建的文件(例如,“BlockForHelper.txt”,我在Eclipse中专门指定并放在项目目录中)时,我收到此错误:
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(); } }
任何人都知道可能是什么原因造成的?
I am trying to save some block coverage using an array of integers that simply saves the number of times a block is executed. For some reason, though, when I try and write to some files that I created ("BlockForHelper.txt" for example, which I made specifically in Eclipse and placed in the project directory), I get this error:
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
and gives me the error:
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(); } }
Anyone know what might be causing this?
原文:https://stackoverflow.com/questions/11620641
最满意答案
我一直在想最近的事情。 我能想出的最佳方法是在页面上放置几个“区域”。 在我的情况下,这些是3列。 我给每个标识符,并在每次将块移动到不同的位置以更新该块的新位置时使用Ajax调用。
例如,一个示例数据库表:
tbl.blocks: userid | blockid | column | placement 1 | 2 | 1 | 3
其中,列是简单的列标识符,布局是该列中的布局。 我在页面加载时使用了一个查询,按照展示位置顺序加载这些块,然后将它们
blockid
指的是一个块表。以下是我看到的相关教程: http : //aymanh.com/drag-drop-portal-interface-with-scriptaculous
I've been thinking about something similar recently. The best method I could come up with was to have several 'zones' on the page where items would be placed. In my case these were 3 columns. I gave each an identifier and used an Ajax call every time a block was moved to a different position to update the new position of that block.
For example, a sample database table:
tbl.blocks: userid | blockid | column | placement 1 | 2 | 1 | 3
Where column is a simple column identifier and placement is the placement within that column. I used a query at page load that loaded the blocks in order of placement, and then wrote them in.
blockid
refers to a table of blocks.Here's a tutorial I found that looks relevant: http://aymanh.com/drag-drop-portal-interface-with-scriptaculous
相关问答
更多-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
将类名添加到div的class属性中。
ERROR DIALOG TEXT
-
如何在jQuery UI中构建一个可保存状态的门户页面?(How to build a portal page with saveable state in jquery UI?)[2023-07-28]
我一直在想最近的事情。 我能想出的最佳方法是在页面上放置几个“区域”。 在我的情况下,这些是3列。 我给每个标识符,并在每次将块移动到不同的位置以更新该块的新位置时使用Ajax调用。 例如,一个示例数据库表: tbl.blocks: userid | blockid | column | placement 1 | 2 | 1 | 3 其中,列是简单的列标识符,布局是该列中的布局。 我在页面加载时使用了一个查询,按照展示位置顺序加载这些块,然后将它们bloc ... -
设置类不会更改默认选项卡。 代替 $( "#tabs" ).tabs(); 尝试这个: $( "#tabs" ).tabs({ active: 4 }); 这将使第五个(零索引)选项卡成为默认的活动选项卡。 Setting a class will not change the default tab. Instead of $( "#tabs" ).tabs(); Try this: $( "#tabs" ).tabs({ active: 4 }); This will make ...
-
如果你不喜欢使用上面的过程...你可以通过切换和粘贴到Google的Closure Compiler来缩小你的JavaScript。 If you don't like using what the process above...you can minify your JavaScript by cutting-and-pasting right into Google's Closure Compiler.
-
根据我的经验,在门户级别没有模块设置的控制注册。 只有Module和TabModule作用域设置,就像你说的那样。 我最喜欢的设置允许'默认'的方式是这样的: 创建设置界面: public interface ISettingsRepository { string ReplyToAddress { get; set; } string InviteEmailSubject { get; set; } } 然后是一个实现类(注意默认值是getter中返回的默认值)。 请参阅将属性值写为模块 ...
-
这应该工作: ui.sref=".phase.task({ phaseId: task.phaseId, taskId: task.taskId })" This should work: ui.sref=".phase.task({ phaseId: task.phaseId, taskId: task.taskId })"
-
jQuery UI状态悬停(jQuery UI state hover)[2022-03-07]
outline: 1px solid #99ccff; background: #3a71c9 url(images/s.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; border将1px添加到您的全宽和高度(+ 2px)。 大纲没有。 outline: 1px solid #99ccff; background: #3a71c9 url(images/s.png) 50% 50% repeat-x; font-weight: no ... -
因此,如果您使用的是Rad 9.5,我假设您每次都要部署登录portlet,这样做会将它们从页面中删除,然后在您进行更改时将它们部署为agian,以保持其位置可以部署和更新他们手动或使用xmlaccess每次更新页面 so if you are using Rad 9.5 I am assuming you are deploying your login portlets each time, in doing so rad removes them from the page and then depl ...
-
在ng-repeat中,你在ui-sref使用了page.slug ,但是在$stateProviderRef.state(page.name, stateObj);创建页面时使用了run函数$stateProviderRef.state(page.name, stateObj); 你正在使用page.name 。 我假设page.slug应该是正确的,因为你有来自ui-sref的management状态 更改$stateProviderRef.state(page.name, stateObj); 到$s ...