You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having run into some issues with using Scanner to read files within the Browser.FS filesystem, I've tried the following on your demo page just to confirm it's not something in my project:
import java.util.Scanner;
import java.io.File;
public class FileTest {
public static void main(String[] args) throws Exception {
File f = new File("test.txt");
Scanner fr = new Scanner(f);
System.out.println("About to try to read...");
while (fr.hasNextLine())
{
System.out.println(fr.nextLine());
}
}
}
I get the same symptoms as in my own project that uses Doppio; the Scanner is instantiated seemingly without incident, but the moment one tries to do anything that involves reading the file, execution seems to hang. It fails silently in that the browser does not block and no console errors are generated.
Attempting a similar simple line-by-line read from a test file using BufferedReader(new FileReader(FILENAME)) works fine - so there seems to be something causing problems in the interaction between Scanner and the Browser.FS-based filesystem.
Have hacked around it for now by using an alternate version of Scanner - see http://nifty.stanford.edu/2006/reges-anagrams/ - but the year on that says it all! Would be nice if the "real" Scanner could be made to work...
The text was updated successfully, but these errors were encountered:
Hi all,
Having run into some issues with using Scanner to read files within the Browser.FS filesystem, I've tried the following on your demo page just to confirm it's not something in my project:
import java.util.Scanner;
import java.io.File;
public class FileTest {
public static void main(String[] args) throws Exception {
File f = new File("test.txt");
Scanner fr = new Scanner(f);
System.out.println("About to try to read...");
while (fr.hasNextLine())
{
System.out.println(fr.nextLine());
}
}
}
I get the same symptoms as in my own project that uses Doppio; the Scanner is instantiated seemingly without incident, but the moment one tries to do anything that involves reading the file, execution seems to hang. It fails silently in that the browser does not block and no console errors are generated.
Attempting a similar simple line-by-line read from a test file using BufferedReader(new FileReader(FILENAME)) works fine - so there seems to be something causing problems in the interaction between Scanner and the Browser.FS-based filesystem.
Have hacked around it for now by using an alternate version of Scanner - see http://nifty.stanford.edu/2006/reges-anagrams/ - but the year on that says it all! Would be nice if the "real" Scanner could be made to work...
The text was updated successfully, but these errors were encountered: