how to write to a file on initramdisk (/jnode)
Submitted by Trickkiste on Tue, 03/02/2004 - 11:59.
hi, i asked that question some time ago at the mailing list, but nobody anwsered,
i tried to write to a file with the following code :
FileWriter fl= new FileWriter("/jnode/test.txt");
fl.write("hello");
fl.close();
but i got an java.lang.IllegalArgumentException : Invalid cluster value
has anybody an idea if this is my fault or the fault of the JNode FS (here fat)?
thx, Andreas
- Login to post comments
is anyone working on fat ?
hi,
is anyone working on the implementation of fat16 to avoid this error?
Andreas
I have the same problem
Andreas,
I have get this same error in my test suite. I have a test suite that will test a FileSystemType implementation. I have it working under Sun JDK and it right now tests FAT16 and FAT12 with no problem. It uses a RamDisk as the underlying device, and uses FormateSystemType.format() to create paritition. As more FileSystemTypes support RW they can be easily plugged into it and automated.
Given that this test runs under Sun's JDK, and fails under JNode I'm lead to believe there is a problem with the implementation of the Java API or JVM. I noticed that when FAT throws an IllegalArgumentException, JUnit also fails with a MethodNotFoundError. When I make my test mimic this failure under Sun's JDK, it only throws an IllegalArgumentException. That descrepency also makes me feel that JNode has differences in its implementation that are contributing to these failures.
Trying to figure out why it failed under JNode I printed out the cluster it was looking for. I found the start cluster well above MAX_INT, and closer to MAX_LONG. This looks similiar to a memory intialization problem. I wonder if newly allocated memory is zero'ed out properly. I also found that trying to allocate a ~10MB ramdisk resulted in an exception from the memory module stating that 10MB was too large to allocate. INterestingly I had requested a byte array of 10,000,000 elements, but it reported that 10,000,004 was too large.
I'm not sure where to go from here other than trying to test the underlying classpath classes. Given that FAT works under Sun's JDK, but fails in JNode I feel like the implementation of classpath or the JVM is the difference. I've been looking into how to get Mauve, (the classpath's test suite) running under JNode. Looks like a lot of work.....
Charlie