D:\temp\java>java ReadFile
Please input the directory name:
c:\Please input the file name:
auto.bat
can't find the file
/*
c:\auto.bat是存在的。如果我直接把"c:\\" 和 “auto.bat”作为参数放到
File input = new File(dir,fileBuf.toString());如
File input = new File("c:\\","auto.bat");
就一点问题没有。
*/
Please input the directory name:
c:\Please input the file name:
auto.bat
can't find the file
/*
c:\auto.bat是存在的。如果我直接把"c:\\" 和 “auto.bat”作为参数放到
File input = new File(dir,fileBuf.toString());如
File input = new File("c:\\","auto.bat");
就一点问题没有。
*/
解决方案 »
- [40分:结贴超快]singleton模式同步锁问题
- java 菜鸟问题
- 怎么查看远程端口是否开通
- 我有个project 要进行数据库连接,是不是在每个类里都要进行数据连接,如果保持数据库连接状态。。
- 使用mm7协议出现的问题
- 使用AlloyLookAndFeel后在登陆框输入中文为什么会抛出异常???
- struts 添加数据问题,!
- 我要怎么把一个文件从默认的unicode编码变成gb_2312编码啊?谢谢!
- 请问怎么下载Java 开放的源代码?
- 一个关于环境变量设置的问题
- 谁有JAVA基础API完整的继承树图??
- 急,struts中怎样利用iterate标记和bean标记的来显示存在session中一个bean的集合中的数据!
-----------刚刚学习,无法回答你,抱歉!
输出fileBuf的值为空,感觉象被丢掉了。
new DataInputStream(
new BufferedInputStream(System.in));
String s;
try {
while((s = in.readLine()).length() != 0)
System.out.println(s);
// An empty line terminates the program
} catch(IOException e) {
e.printStackTrace();
}