FAT Directory Reading?

Mar 21, 2012 at 9:01 AM

I've been looking through Cosmos for a large majority of the day and I'm loving what I'm seeing so far. From other discussions it seems that File IO is relatively new and mostly reading without any writing (at least FAT seems to be that way).

I've gotten as far as this discussion has in that I can read the files in the root. Specifically, I can see their existence, their size, and (if they're a file) the content of the file itself. The SubDir directory, though, I have no clue how to access. Is it supported and if so, how can I get started at browsing sub folders?

Also, in my wandering through the FAT File Systems, I eventually settled to this code to open what I assume to be the mounted HD for the image:

List<BlockDevice> devices = BlockDevice.Devices;
FatFileSystem fat = new FatFileSystem(devices[1]);

The list devices only has 2 elements when I run it, but if I use devices[0] an error is thrown saying "Invalid data size". My assumption is that at index 0, I'm trying to reference the mounted ISO image that's for the OS to boot and that's not supported. I'm not 100% about this and appreciate any insight anybody might have as to what these 2 devices truly are. I'll be the first to say I'm taking shots in the dark for the safe of educating myself.

VS 2010 Professional, MS 5 User Kit

Coordinator
Mar 21, 2012 at 9:07 AM
MS5 is ancient: you could use the latest release as well: it contains file reading if i recall correctly.

On Wed, Mar 21, 2012 at 10:01 AM, coreyog <notifications@codeplex.com> wrote:

From: coreyog

I've been looking through Cosmos for a large majority of the day and I'm loving what I'm seeing so far. From other discussions it seems that File IO is relatively new and mostly reading without any writing (at least FAT seems to be that way).

I've gotten as far as this discussion has in that I can read the files in the root. Specifically, I can see their existence, their size, and (if they're a file) the content of the file itself. The SubDir directory, though, I have no clue how to access. Is it supported and if so, how can I get started at browsing sub folders?

Also, in my wandering through the FAT File Systems, I eventually settled to this code to open what I assume to be the mounted HD for the image:

List<BlockDevice> devices = BlockDevice.Devices;
FatFileSystem fat = new FatFileSystem(devices[1]);

The list devices only has 2 elements when I run it, but if I use devices[0] an error is thrown saying "Invalid data size". My assumption is that at index 0, I'm trying to reference the mounted ISO image that's for the OS to boot and that's not supported. I'm not 100% about this and appreciate any insight anybody might have as to what these 2 devices truly are. I'll be the first to say I'm taking shots in the dark for the safe of educating myself.

VS 2010 Professional, MS 5 User Kit

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Mar 21, 2012 at 5:41 PM

I may have misguessed the Milestone version. I just downloaded the installer from codeplex yesterday, and according to the download page I have everything from changeset 87612 released Jan 22nd 2012 (by you, mterwoord, actually).

Coordinator
Mar 22, 2012 at 8:00 AM
ok, then you're not on MS5: we dont use the MS numbering anymore..

FAT read/write is still a work in progress. Maybe someone else will join this discussion to answer your question regarding browsing subfolder..

On Wed, Mar 21, 2012 at 6:41 PM, coreyog <notifications@codeplex.com> wrote:

From: coreyog

I may have misguessed the Milestone version. I just downloaded the installer from codeplex yesterday, and according to the download page I have everything from changeset 87612 released Jan 22nd 2012 (by you, mterwoord, actually).

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Mar 24, 2012 at 1:10 PM

Hey,

because of this thread, I tried to use the FatFileSystem too, and was able to read the root directory...
Also i could read some files content with the ReadCluster method, but I have absolutly no idea how I can get the cluster-index of a file, when i acces it by GetRoot()

Maybe i should mention this is my first time trying to access a fiolesystem directly...

maybe you can tell me, coreyog

 

mfg

AntVickl0r

Visual Studio 10 Premium, Cosmos 87612

Coordinator
Mar 24, 2012 at 1:31 PM
On 3/24/2012 9:10 AM, AntVickl0r wrote:
> because of this thread, I tried to use the FatFileSystem too, and was
> able to read the root directory...
> Also i could read some files content with the ReadCluster method, but I
> have absolutly no idea how I can get the cluster-index of a file, when i
> acces it by GetRoot()
>
> Maybe i should mention this is my first time trying to access a
> fiolesystem directly...

Look at the project in Kudzu playground, it already does this and much more.
Mar 24, 2012 at 2:45 PM

thanks for you quik reply.

First I coud not understand - bcause i'm new to codeplex...

But now i think you meant your BreakpointOS Project... did I get it right?^^
https://cosmos.svn.codeplex.com/svn/source2/Users/Kudzu/Breakpoints/

But i could only see it because of google, so it was a little hard to find xD

Coordinator
Mar 24, 2012 at 3:01 PM
On 3/24/2012 10:45 AM, AntVickl0r wrote:
> But now i think you meant your BreakpointOS Project... did I get it right?^^
> https://cosmos.svn.codeplex.com/svn/source2/Users/Kudzu/Breakpoints/

Yes its in there.

> But i could only see it because of google, so it was a little hard to
> find xD

Its in SVN, all the playgrounds are grouped together.