Discussion:
FileSystem Misunderstanding?
(too old to reply)
Chris Thompson
2008-10-22 16:01:15 UTC
Permalink
I was under the impression that to write to a file, we would just make a
call to StubFileSystem's write method, since regular FileSystem only
provides us with support for open, create, and remove. However, it seems
that every instance of a FileSystem (the one created in ThreadedKernel
that is returned by Machine.java) are of the regular FileSystem type,
and I can find no ways to write to a file without implementing the
details myself, which we were not supposed to do. I don't think we can
cast fileSystem as a StubFileSystem, nor can I create any new instances
of a StubFileSystem (it requires parameters that are only available to
Machine.java), so I think I'm missing something big here. Is there an
object that we have access to that has the ability to write to disk?
Chris Thompson
2008-10-23 18:36:16 UTC
Permalink
I knew that's where the functionality was, I just couldn't figure out
what instantiated something with that functionality. FileSystem won't
allow us to access it directly, but an OpenFile returned by a call to
FileSystem's Open will. I just didn't realize that until it was clarified.
...
I think the functionality is in those things.
Chris Thompson
2008-10-24 22:09:00 UTC
Permalink
Ohh, my apologies. Now that I've reread your post in greater detail, it
does show what I was looking to know. I read the code somewhat in your
post and could tell that it was StubFileSystem code, but thanks to lack
of sleep and the inconvenient character wrap limit, I thought that it
was a direct reposting of the code and that you meant that the functions
I wanted were in StubFileSystem. (Well, that is sorta what you meant,
but I didn't even realize those comments weren't part of the original
code) Looking back, that was a helpful reply, although a bit difficult
to read (at least over Thunderbird). Sorry for my haste.
So you are saying I was superfluous? {:( Sorry. I should have been
more distinct on the various extensions of interfaces and members
and such.
Loading...