File Size

Topics: Using Cosmos (Developing your own OS, projects, etc)
Jul 24, 2012 at 2:42 PM

I am trying to write my own FAT handler but I am running into an issue when I am trying to retrieve file sizes. Here is my code:

            for (int i = 0; i < FATFilesystemListing.Count; i++)
            {
                var xItem = FATFilesystemListing[i];

                if (xItem is Sys.Filesystem.FAT.Listing.FatDirectory)
                {
                    Kernel.nsConsole.WriteLine("<" + xItem.Name + ">", SystemComponents.ConsoleControl.WriteType.Info);
                }
                else if (xItem is Sys.Filesystem.FAT.Listing.FatFile)
                {
                    Kernel.nsConsole.WriteLine(xItem.Name + " - " + xItem.Size, SystemComponents.ConsoleControl.WriteType.Info);
                }
            }
xItem.Size is always 0... Does anyone know why?

Coordinator
Jul 24, 2012 at 4:12 PM
On 7/24/2012 9:42 AM, DarkMatter08 wrote:
> I am trying to write my own FAT handler but I am running into an issue
> when I am trying to retrieve file sizes. Here is my code:
>
> for (int i = 0; i < FATFilesystemListing.Count; i++)
> {
> var xItem = FATFilesystemListing[i];
>
> if (xItemis Sys.Filesystem.FAT.Listing.FatDirectory)
> {
> Kernel.nsConsole.WriteLine("<" + xItem.Name +">", SystemComponents.ConsoleControl.WriteType.Info);
> }
> else if (xItemis Sys.Filesystem.FAT.Listing.FatFile)
> {
> Kernel.nsConsole.WriteLine(xItem.Name +" -" + xItem.Size, SystemComponents.ConsoleControl.WriteType.Info);
> }
> }
>
> xItem.Size is always 0... Does anyone know why?

Take a look at my FAT implementation, Im pretty sure file size works in it.
Jul 24, 2012 at 7:06 PM

I actually am looking at your implementation from the Dev Kit. For some reason the file size is showing 0 and so is the block size and count for the device.

Coordinator
Jul 24, 2012 at 7:20 PM
On 7/24/2012 2:06 PM, DarkMatter08 wrote:
> I actually am looking at your implementation from the Dev Kit. For some
> reason the file size is showing 0 and so is the block size and count for
> the device.

If its using int64, its prob the compiler bug I went back to work on.