Thanks Steve! It worked. I can't believe it was so simple.
brianFri 27 May 2022
Just a note: the sys::File.open method opens as a random access file (just like java.io.RandomAccessFile). In general its always better to open as a stream if you can using File.out if you don't need random access.
LightDyeSat 28 May 2022
Thanks Brian for clarifying the difference between open and out.
LightDye Thu 26 May 2022
Hi all,
I'm trying to open and read a resource file that is included in a pod, but I'm getting this output from the code below:
Main.fan
The file called
file.txt
exists in theres/
directory and I have included this line inbuild.fan
Can anyone please let me know how this is done, or what I'm doing wrong here?
SlimerDude Fri 27 May 2022
Hey
LightDye
, good to see you back!I believe the clue is in the err msg,
"sys::UnsupportedErr: ZipEntryFile.open"
and that you cannot useopen()
on a Zip file entry.So instead, try using the read methods on the File object directly:
Hope this helps,
Steve.
LightDye Fri 27 May 2022
Thanks Steve! It worked. I can't believe it was so simple.
brian Fri 27 May 2022
Just a note: the
sys::File.open
method opens as a random access file (just like java.io.RandomAccessFile). In general its always better to open as a stream if you can using File.out if you don't need random access.LightDye Sat 28 May 2022
Thanks Brian for clarifying the difference between open and out.