Dear all,
I tried to read a large number of files into an ArrayList with the
following code:
var file_list:ArrayList[String]=new ArrayList[String]();
for( f1 in (0..1000)){
for(f2 in (0..30)){
val f_name=f1.toString()+"_"+f2.toString();
val file=new File(f_name);
if(file.exists()) {
//Console.OUT.println(f1+"_"+f2);
for(s in file.lines()){
file_list.add(s);
}
}
}
}
But in the implementations I always meet the error:
Uncaught exception at place 0: x10.lang.MultipleExceptions
x10.io.FileNotFoundException: 50_22
at x10::lang::CheckedThrowable::fillInStackTrace()
at x10aux::throwException(x10::lang::CheckedThrowable*)
at
x10::io::FileReader__FileInputStream::_constructor(x10::lang::String*)
at x10::io::FileReader__FileInputStream::_make(x10::lang::String*)
at x10::io::FileReader::_constructor(x10::io::File*)
at x10::io::FileReader::_make(x10::io::File*)
at x10::io::File::openRead()
at x10::io::File::lines()
at active_read::main(x10::array::Array<x10::lang::String*>*)
at x10aux::BootStrapClosure::__apply()
at x10::lang::VoidFun_0_0::__apply(x10::lang::VoidFun_0_0*)
at x10::lang::Activity::run()
at x10::lang::Runtime__Worker::loop()
at x10::lang::Runtime__Worker::__apply()
at x10::lang::Runtime__Pool::__apply(int)
at x10::lang::Runtime::start(x10::lang::VoidFun_0_0*)
at
at GC_inner_start_routine
at GC_call_with_stack_base
at
at clone
Actually the file 50_22 exists. I tried to initialized the size of the
arraylist with a number large enough, and close the filereader after
reading each file as well, but still meet the same error. Is there any
comment about this?
Thanks,
Long
------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
X10-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/x10-users