• Home
  • Install
  • Cosmos Website
  • Articles
  • Cosmos
  • X#
  • IL2CPU
Show / Hide Table of Contents
  • Cosmos.Core
    • ACPI
    • ACPI.RSDPtr
    • Bootstrap
    • CPU
    • GCImplementation
    • GCTable
    • Global
    • INTs
    • INTs.EFlagsEnum
    • INTs.ExceptionInterruptDelegate
    • INTs.IRQContext
    • INTs.IRQDelegate
    • INTs.MMXContext
    • INTs.TSS
    • IOPort
    • KernelPanics
    • ManagedMemoryBlock
    • MemoryBlock
    • MemoryBlock08
    • MemoryBlock16
    • MemoryBlock32
    • MemoryMapBlock
    • MemoryOperations
    • PIC
    • PIC.Cmd
    • RawMemoryMapBlock
    • VTable
    • VTablesImpl
  • Cosmos.Core.IOGroup
    • ATA
    • PIC
    • PS2Controller
  • Cosmos.Core.Memory
    • Heap
    • HeapLarge
    • HeapMedium
    • HeapSmall
    • ObjectGCStatus
    • RAT
    • RAT.PageType
    • RootSMTBlock
    • SMTBlock
    • SMTPage
  • Cosmos.Core.MemoryGroup
    • AHCI
  • Cosmos.Core.Multiboot
    • Multiboot2
  • Cosmos.Core.Multiboot.Tags
    • AcpiNew
    • AcpiOld
    • BasicMemoryInformation
    • EFI64
    • Framebuffer
    • MB2Tag
    • MemoryMap
  • Cosmos.Core_Asm
    • ArrayClearAsm
    • ArrayGetLengthAsm
    • ArrayImpl
    • ArrayInternalCopyAsm
    • BufferBlockCopyAsm
    • BufferImpl
    • CPUCanReadCPUIDAsm
    • CPUDisableINTsAsm
    • CPUEnableINTsAsm
    • CPUGetEBPValue
    • CPUGetEndOfKernelAsm
    • CPUGetESPValue
    • CPUGetStackStart
    • CPUHaltAsm
    • CPUImpl
    • CPUInitFloatAsm
    • CPUInitSSEAsm
    • CPUReadCPUIDAsm
    • CPUReadModelSpecificRegisterAsm
    • CPUReadTimestampCounterAsm
    • CPUSetESPValue
    • CPUUpdateIDTAsm
    • CPUZeroFillAsm
    • DelegateCtorAsm
    • DelegateGetMulticastInvokeAsm
    • DelegateImpl
    • DelegateInvokeAsm
    • GCImplementationImpl
    • IOPortImpl
    • Multiboot2Impl
    • Multiboot2ImplAsm
    • RuntimeHelpersImpl
  • Cosmos.Core_Asm.MemoryOperations
    • MemoryOperationsCopy128BlocksAsm
    • MemoryOperationsCopy128BytesAsm
    • MemoryOperationsCopy16BytesAsm
    • MemoryOperationsCopy32BytesAsm
    • MemoryOperationsCopy64BytesAsm
    • MemoryOperationsFill16BlocksAsm
  • Cosmos.Debug.Kernel
    • Debugger
    • DebuggerFactory
  • Cosmos.HAL
    • BaudRate
    • Bootstrap
    • CardType
    • ClassID
    • COMPort
    • DataReceivedHandler
    • Device
    • DeviceID
    • Global
    • KeyboardBase
    • KeyboardBase.KeyPressedEventHandler
    • MouseBase
    • MouseBase.MouseChangedEventHandler
    • NetworkDevice
    • PCI
    • PCIBaseAddressBar
    • PCIDevice
    • PCIDevice.Config
    • PCIDevice.DeviceClass
    • PCIDevice.PCIBist
    • PCIDevice.PCICommand
    • PCIDevice.PCIHeaderType
    • PCIDevice.PCIInterruptPIN
    • PCIDeviceBridge
    • PCIDeviceCardbus
    • PCIDeviceNormal
    • PCSpeaker
    • PIT
    • PIT.PITTimer
    • PIT.PITTimer.OnTrigger
    • Power
    • ProgramIF
    • PS2Controller
    • PS2Keyboard
    • PS2Mouse
    • RTC
    • SerialPort
    • SpeakerExtensions
    • SubclassID
    • TextScreen
    • TextScreenBase
    • TextScreenHelpers
    • VendorID
  • Cosmos.HAL.Audio
    • AudioBitDepth
    • AudioBuffer
    • IAudioBufferProvider
    • SampleFormat
  • Cosmos.HAL.BlockDevice
    • AHCI
    • Ata
    • Ata.BusPositionEnum
    • Ata.ControllerIdEnum
    • ATA_PIO
    • ATA_PIO.Cmd
    • ATA_PIO.DvcSelVal
    • ATA_PIO.Ident
    • ATA_PIO.SpecLevel
    • ATA_PIO.Status
    • ATAPI
    • ATAPI.PacketCommands
    • BlockDevice
    • BlockDeviceType
    • EBR
    • EBR.PartInfo
    • GPT
    • GPT.GPartInfo
    • IDE
    • MBR
    • MBR.PartInfo
    • Partition
  • Cosmos.HAL.BlockDevice.Ports
    • SATA
    • SATAPI
    • StoragePort
  • Cosmos.HAL.BlockDevice.Registers
    • AHCISignature
    • ATACommands
    • ATADeviceStatus
    • Base
    • Bases
    • CommandAndStatus
    • CurrentInterfaceSpeedStatus
    • DeviceDetectionStatus
    • FISRegisterD2H
    • FISRegisterH2D
    • FISSize
    • FISType
    • GenericRegisters
    • HBACommandHeader
    • HBACommandTable
    • HBAPRDTEntry
    • InterfacePowerManagementStatus
    • InterruptEnable
    • InterruptStatus
    • PortRegisters
    • PortType
  • Cosmos.HAL.Drivers.Audio
    • AC97
    • AudioDriver
  • Cosmos.HAL.Drivers.Network
    • AMDPCNetII
    • E1000
    • E1000.RXDesc
    • E1000.TXDesc
    • E1000DeviceID
    • RTL8139
  • Cosmos.HAL.Drivers.USB
    • USBHost
  • Cosmos.HAL.Drivers.Video
    • VBEDriver
    • VGADriver
    • VGADriver.ColorDepth
    • VGADriver.ScreenSize
    • VGADriver.TextSize
  • Cosmos.HAL.Drivers.Video.SVGAII
    • Capability
    • FIFO
    • FIFOCommand
    • ID
    • IOPortOffset
    • Register
    • VMWareSVGAII
  • Cosmos.HAL.Network
    • MACAddress
    • NetworkInit
  • Cosmos.System
    • Console
    • ConsoleKeyEx
    • ConsoleKeyExExtensions
    • Durations
    • Global
    • Kernel
    • KeyboardManager
    • KeyEvent
    • KeyEvent.KeyEventType
    • KeyMapping
    • MouseManager
    • MouseState
    • Notes
    • PCSExtensions
    • PCSpeaker
    • Power
    • ScanMapBase
    • VMTools
  • Cosmos.System.Audio
    • AudioManager
    • AudioMixer
    • AudioStream
  • Cosmos.System.Audio.DSP.Processing
    • AudioPostProcessor
    • GainPostProcessor
  • Cosmos.System.Audio.IO
    • AudioBufferReader
    • AudioBufferReadWriteBase
    • AudioBufferWriter
    • MemoryAudioStream
    • SeekableAudioStream
  • Cosmos.System.ExtendedASCII
    • CosmosEncodingProvider
  • Cosmos.System.FileSystem
    • CosmosVFS
    • Disk
    • FileSystem
    • FileSystemFactory
    • ManagedPartition
  • Cosmos.System.FileSystem.FAT
    • FatFileSystemFactory
  • Cosmos.System.FileSystem.FAT.Listing
    • FatDirectoryEntryAttributeConsts
    • FatDirectoryEntryMetadata
    • FatDirectoryEntryMetadata.LongFilenameEntryMetadata
  • Cosmos.System.FileSystem.ISO9660
    • ISO9660FileSystem
    • ISO9660FileSystemFactory
  • Cosmos.System.FileSystem.Listing
    • DirectoryEntry
    • DirectoryEntryTypeEnum
  • Cosmos.System.FileSystem.VFS
    • FileSystemManager
    • VFSBase
    • VFSManager
  • Cosmos.System.Graphics
    • Bitmap
    • Canvas
    • ColorDepth
    • ColorOrder
    • FullScreenCanvas
    • Image
    • ImageFormat
    • Mode
    • SVGAIICanvas
    • VBECanvas
    • VGACanvas
    • VGAScreen
  • Cosmos.System.Graphics.Fonts
    • Font
    • PCScreenFont
    • UnicodeMapping
  • Cosmos.System.Helpers
    • ArrayHelper
  • Cosmos.System.IO
    • ConsoleStream
    • SyncTextReader
  • Cosmos.System.Keyboard
    • KeyEventHelper
  • Cosmos.System.Network
    • EthernetPacket
    • NetworkDebugger
    • NetworkStack
  • Cosmos.System.Network.ARP
    • ARPPacket
  • Cosmos.System.Network.Config
    • DNSConfig
    • IPConfig
    • NetworkConfig
    • NetworkConfiguration
  • Cosmos.System.Network.IPv4
    • Address
    • EndPoint
    • ICMPClient
    • ICMPPacket
    • IPPacket
    • OutgoingBuffer
  • Cosmos.System.Network.IPv4.TCP
    • Flags
    • Status
    • Tcp
    • TCPOption
    • TCPPacket
    • TransmissionControlBlock
  • Cosmos.System.Network.IPv4.UDP
    • UdpClient
    • UDPPacket
  • Cosmos.System.Network.IPv4.UDP.DHCP
    • DHCPClient
    • DHCPOption
    • DHCPPacket
  • Cosmos.System.Network.IPv4.UDP.DNS
    • DNSAnswer
    • DnsClient
    • DNSPacket
    • DNSPacketAnswer
    • DNSPacketAsk
    • DNSQuery
    • ReplyCode
  • Cosmos.System.ScanMaps
    • DEStandardLayout
    • ESStandardLayout
    • FRStandardLayout
    • GBStandardLayout
    • TRStandardLayout
    • US_Dvorak
    • USStandardLayout

Class CosmosVFS

Cosmos default virtual file system.

Inheritance
System.Object
VFSBase
CosmosVFS
Inherited Members
VFSBase.DirectorySeparatorChar
VFSBase.AltDirectorySeparatorChar
VFSBase.VolumeSeparatorChar
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Cosmos.System.FileSystem
Assembly: Cosmos.System2.dll
Syntax
public class CosmosVFS : VFSBase

Properties

| Improve this Doc View Source

Disks

List of disks.

Declaration
public List<Disk> Disks { get; }
Property Value
Type Description
System.Collections.Generic.List<Disk>

Methods

| Improve this Doc View Source

CreateDirectory(String)

Creates a directory.

Declaration
public override DirectoryEntry CreateDirectory(string aPath)
Parameters
Type Name Description
System.String aPath

The full path including the directory to create.

Returns
Type Description
DirectoryEntry

DirectoryEntry value.

Overrides
VFSBase.CreateDirectory(String)
Exceptions
Type Condition
System.ArgumentNullException
  • Thrown if aPath is null.
  • aNewDirectory is null or empty.
  • memory error.
System.ArgumentOutOfRangeException

Thrown on memory error / unknown directory entry type.

System.OverflowException

Thrown when data lenght is greater then Int32.MaxValue.

System.Exception
  • Thrown when data size invalid.
  • invalid directory entry type.
  • the entry at aPath is not a directory.
  • memory error.
System.ArgumentException
  • Thrown if aPath length is zero.
  • Thrown if aPath is invalid.
  • memory error.
System.RankException

Thrown on fatal error.

System.ArrayTypeMismatchException

Thrown on fatal error.

System.InvalidCastException

Thrown on memory error.

System.IO.PathTooLongException

Thrown when The aPath is longer than the system defined maximum length.

| Improve this Doc View Source

CreateFile(String)

Creates a new file.

Declaration
public override DirectoryEntry CreateFile(string aPath)
Parameters
Type Name Description
System.String aPath

The full path including the file to create.

Returns
Type Description
DirectoryEntry

DirectoryEntry value.

Overrides
VFSBase.CreateFile(String)
Exceptions
Type Condition
System.ArgumentNullException
  • Thrown if aPath is null.
  • aNewDirectory is null or empty.
  • memory error.
System.ArgumentOutOfRangeException

Thrown on memory error / unknown directory entry type.

System.OverflowException

Thrown when data lenght is greater then Int32.MaxValue.

System.Exception
  • Thrown when data size invalid.
  • invalid directory entry type.
  • the entry at aPath is not a file.
  • Thrown when the parent directory of aPath is not a directory.
  • memory error.
System.ArgumentException
  • Thrown if aPath length is zero.
  • Thrown if aPath is invalid.
  • memory error.
System.RankException

Thrown on fatal error.

System.ArrayTypeMismatchException

Thrown on fatal error.

System.InvalidCastException

Thrown on memory error.

System.IO.PathTooLongException

Thrown when The aPath is longer than the system defined maximum length.

| Improve this Doc View Source

DeleteDirectory(DirectoryEntry)

Deletes an empty directory.

Declaration
public override bool DeleteDirectory(DirectoryEntry aPath)
Parameters
Type Name Description
DirectoryEntry aPath

The full path.

Returns
Type Description
System.Boolean

TRUE on success.

Overrides
VFSBase.DeleteDirectory(DirectoryEntry)
| Improve this Doc View Source

DeleteFile(DirectoryEntry)

Deletes a file.

Declaration
public override bool DeleteFile(DirectoryEntry aPath)
Parameters
Type Name Description
DirectoryEntry aPath

The full path.

Returns
Type Description
System.Boolean

TRUE on success.

Overrides
VFSBase.DeleteFile(DirectoryEntry)
| Improve this Doc View Source

GetAvailableFreeSpace(String)

Get available free space.

Declaration
public override long GetAvailableFreeSpace(string aDriveId)
Parameters
Type Name Description
System.String aDriveId

A drive id to get the size of.

Returns
Type Description
System.Int64

long value.

Overrides
VFSBase.GetAvailableFreeSpace(String)
Exceptions
Type Condition
System.ArgumentException

Thrown when aDriveId is null or empty.

System.Exception

Unable to determine filesystem for path: + aDriveId

| Improve this Doc View Source

GetDirectory(String)

Gets the directory entry for a directory.

Declaration
public override DirectoryEntry GetDirectory(string aPath)
Parameters
Type Name Description
System.String aPath

The full path path.

Returns
Type Description
DirectoryEntry

A directory entry for the directory.

Overrides
VFSBase.GetDirectory(String)
Exceptions
Type Condition
System.Exception

Thrown when the entry at aPath is not a directory.

| Improve this Doc View Source

GetDirectoryListing(DirectoryEntry)

Gets the directory listing for a directory entry.

Declaration
public override List<DirectoryEntry> GetDirectoryListing(DirectoryEntry aDirectory)
Parameters
Type Name Description
DirectoryEntry aDirectory

The directory entry.

Returns
Type Description
System.Collections.Generic.List<DirectoryEntry>

DirectoryEntry type list value.

Overrides
VFSBase.GetDirectoryListing(DirectoryEntry)
Exceptions
Type Condition
System.ArgumentException
  • Thrown if aDirectory is null or empty.
  • aDirectory.mFullPath is null or empty.
  • Memory error.
  • Fatal error.
System.ArgumentNullException
  • Thrown if aFS is null.
  • Root directory is null.
  • Memory error.
System.ArgumentOutOfRangeException
  • Thrown when root directory address is smaller then root directory address.
  • Memory error.
System.OverflowException
  • Thrown when aDirectory.mFullPath is too deep.
  • Data lenght is greater then Int32.MaxValue.
System.Exception
  • Thrown when unable to determine filesystem for path: + aDirectory.mFullPath.
  • data size invalid.
  • invalid directory entry type.
  • path not found.
| Improve this Doc View Source

GetDirectoryListing(String)

Gets the directory listing for a path.

Declaration
public override List<DirectoryEntry> GetDirectoryListing(string aPath)
Parameters
Type Name Description
System.String aPath

The full path.

Returns
Type Description
System.Collections.Generic.List<DirectoryEntry>

DirectoryEntry list value.

Overrides
VFSBase.GetDirectoryListing(String)
Exceptions
Type Condition
System.ArgumentException
  • Thrown if aPath is null or empty.
  • Root path is null or empty.
  • Memory error.
  • Fatal error.
System.ArgumentNullException
  • Thrown if aFS is null.
  • Root directory is null.
  • Memory error.
System.ArgumentOutOfRangeException
  • Thrown when root directory address is smaller then root directory address.
  • Memory error.
System.OverflowException
  • Thrown when aPath is too deep.
  • Data lenght is greater then Int32.MaxValue.
System.Exception
  • Thrown when unable to determine filesystem for path: + aPath.
  • data size invalid.
  • invalid directory entry type.
  • path not found.
| Improve this Doc View Source

GetDisks()

Declaration
public override List<Disk> GetDisks()
Returns
Type Description
System.Collections.Generic.List<Disk>
Overrides
VFSBase.GetDisks()
| Improve this Doc View Source

GetFile(String)

Gets the directory entry for a file.

Declaration
public override DirectoryEntry GetFile(string aPath)
Parameters
Type Name Description
System.String aPath

The full path.

Returns
Type Description
DirectoryEntry

A directory entry for the file.

Overrides
VFSBase.GetFile(String)
Exceptions
Type Condition
System.Exception

Thrown when the entry at aPath is not a file.

| Improve this Doc View Source

GetFileAttributes(String)

Gets the attributes for a File / Directory.

Declaration
public override FileAttributes GetFileAttributes(string aPath)
Parameters
Type Name Description
System.String aPath

The path of the File / Directory.

Returns
Type Description
System.IO.FileAttributes

The File / Directory attributes.

Overrides
VFSBase.GetFileAttributes(String)
Exceptions
Type Condition
System.ArgumentException
  • Thrown if aPath is null or empty.
  • Thrown when aFS root path is null or empty.
  • Thrown on memory error.
  • Fatal error.
System.ArgumentNullException
  • Thrown if aFS is null.
  • Thrown when root directory is null.
  • Thrown on memory error.
System.ArgumentOutOfRangeException
  • Thrown when root directory address is smaller then root directory address.
  • Thrown on memory error.
System.OverflowException
  • Thrown when aPath is too deep.
  • Thrown when data lenght is greater then Int32.MaxValue.
System.Exception
  • Thrown when data size invalid.
  • Thrown on invalid directory entry type.
  • Thrown when aPath entry not found.
  • Thrown when unable to determine filesystem for path: + aPath.
  • Thrown aPath is neither a file neither a directory.
| Improve this Doc View Source

GetFileSystemLabel(String)

Get file system label.

Declaration
public override string GetFileSystemLabel(string aDriveId)
Parameters
Type Name Description
System.String aDriveId

A drive id.

Returns
Type Description
System.String

string value.

Overrides
VFSBase.GetFileSystemLabel(String)
Exceptions
Type Condition
System.ArgumentException

Thrown when aDriveId is null or empty.

System.Exception

Unable to determine filesystem for path: + aDriveId

| Improve this Doc View Source

GetFileSystemType(String)

Get file system type.

Declaration
public override string GetFileSystemType(string aDriveId)
Parameters
Type Name Description
System.String aDriveId

A drive id.

Returns
Type Description
System.String

string value.

Overrides
VFSBase.GetFileSystemType(String)
Exceptions
Type Condition
System.ArgumentException

Thrown when aDriveId is null or empty.

System.Exception

Unable to determine filesystem for path: + aDriveId

| Improve this Doc View Source

GetNextFilesystemLetter()

Declaration
public override string GetNextFilesystemLetter()
Returns
Type Description
System.String
Overrides
VFSBase.GetNextFilesystemLetter()
| Improve this Doc View Source

GetTotalFreeSpace(String)

Get total free space.

Declaration
public override long GetTotalFreeSpace(string aDriveId)
Parameters
Type Name Description
System.String aDriveId

A drive id to get the size of.

Returns
Type Description
System.Int64

long value.

Overrides
VFSBase.GetTotalFreeSpace(String)
Exceptions
Type Condition
System.ArgumentException

Thrown when aDriveId is null or empty.

System.Exception

Unable to determine filesystem for path: + aDriveId

| Improve this Doc View Source

GetTotalSize(String)

Get total size in bytes.

Declaration
public override long GetTotalSize(string aDriveId)
Parameters
Type Name Description
System.String aDriveId

A drive id to get the size of.

Returns
Type Description
System.Int64

long value.

Overrides
VFSBase.GetTotalSize(String)
Exceptions
Type Condition
System.ArgumentException

Thrown when aDriveId is null or empty.

System.Exception

Unable to determine filesystem for path: + aDriveId

| Improve this Doc View Source

GetVolume(String)

Gets the directory entry for a volume.

Declaration
public override DirectoryEntry GetVolume(string aPath)
Parameters
Type Name Description
System.String aPath

The volume root path.

Returns
Type Description
DirectoryEntry

A directory entry for the volume.

Overrides
VFSBase.GetVolume(String)
Exceptions
Type Condition
System.ArgumentException

Thrown when aPath is null or empty.

System.Exception

Unable to determine filesystem for path: + aPath

System.ArgumentNullException

Thrown if filesystem is null.

System.ArgumentOutOfRangeException

Thrown when root directory address is smaller then root directory address.

| Improve this Doc View Source

GetVolumes()

Gets the volumes for all registered file systems.

Declaration
public override List<DirectoryEntry> GetVolumes()
Returns
Type Description
System.Collections.Generic.List<DirectoryEntry>

A list of directory entries for all volumes.

Overrides
VFSBase.GetVolumes()
Exceptions
Type Condition
System.ArgumentNullException

Thrown if filesystem is null.

System.ArgumentOutOfRangeException

Thrown when root directory address is smaller then root directory address.

System.ArgumentException

Thrown when root path is null or empty.

| Improve this Doc View Source

Initialize(Boolean)

Initializes the virtual file system.

Declaration
public override void Initialize(bool aShowInfo)
Parameters
Type Name Description
System.Boolean aShowInfo
Overrides
VFSBase.Initialize(Boolean)
Exceptions
Type Condition
System.IO.IOException

Thrown on I/O exception.

System.ArgumentNullException

Thrown on memory error.

System.OverflowException

Thrown on memory error.

System.Exception

Thrown on memory error.

System.ArgumentException

Thrown on memory error.

System.ArgumentOutOfRangeException

Thrown on memory error.

System.IO.PathTooLongException

Thrown on fatal error.

System.IO.FileNotFoundException

Thrown on memory error.

System.IO.DirectoryNotFoundException

Thrown on fatal error.

| Improve this Doc View Source

InitializePartitions()

Mounts filesystems.

Declaration
protected virtual void InitializePartitions()
| Improve this Doc View Source

IsValidDriveId(String)

Verifies if driveId is a valid id for a drive.

Declaration
public override bool IsValidDriveId(string driveId)
Parameters
Type Name Description
System.String driveId

The id of the drive.

Returns
Type Description
System.Boolean

true if the drive id is valid, false otherwise.

Overrides
VFSBase.IsValidDriveId(String)
Exceptions
Type Condition
System.ArgumentOutOfRangeException

Thrown if driveId length is smaller then 2, or greater than Int32.MaxValue.

| Improve this Doc View Source

SetFileAttributes(String, FileAttributes)

Sets the attributes for a File / Directory. Not implemented.

Declaration
public override void SetFileAttributes(string aPath, FileAttributes fileAttributes)
Parameters
Type Name Description
System.String aPath

The path of the File / Directory.

System.IO.FileAttributes fileAttributes

The attributes of the File / Directory.

Overrides
VFSBase.SetFileAttributes(String, FileAttributes)
Exceptions
Type Condition
System.NotImplementedException

Thrown always

| Improve this Doc View Source

SetFileSystemLabel(String, String)

Set file system type.

Declaration
public override void SetFileSystemLabel(string aDriveId, string aLabel)
Parameters
Type Name Description
System.String aDriveId

A drive id.

System.String aLabel

A label to be set.

Overrides
VFSBase.SetFileSystemLabel(String, String)
Exceptions
Type Condition
System.ArgumentException

Thrown when aDriveId is null or empty.

System.Exception

Unable to determine filesystem for path: + aDriveId

See Also

VFSBase
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
☀
☾