Skip to content

Commit

Permalink
Fixed creating in subdirectories.
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbetros committed May 15, 2016
1 parent 7f9716f commit 5a26ea5
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 190 deletions.
19 changes: 7 additions & 12 deletions source/Cosmos.System/FileSystem/CosmosVFS.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define COSMOSDEBUG
//#define COSMOSDEBUG

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -51,7 +51,7 @@ public override void Initialize()
/// <exception cref="ArgumentException">aPath</exception>
public override DirectoryEntry CreateFile(string aPath)
{
Global.mFileSystemDebugger.SendInternal("CosmosVFS.CreateFile:");
Global.mFileSystemDebugger.SendInternal("--- CosmosVFS.CreateFile ---");

if (aPath == null)
{
Expand Down Expand Up @@ -104,7 +104,7 @@ public override DirectoryEntry CreateFile(string aPath)
/// <exception cref="ArgumentException">aPath</exception>
public override DirectoryEntry CreateDirectory(string aPath)
{
Global.mFileSystemDebugger.SendInternal("CosmosVFS.CreateDirectory:");
Global.mFileSystemDebugger.SendInternal("-- CosmosVFS.CreateDirectory ---");

if (aPath == null)
{
Expand Down Expand Up @@ -281,7 +281,7 @@ protected virtual void InitializePartitions()
{
for (int i = 0; i < mPartitions.Count; i++)
{
Global.mFileSystemDebugger.SendInternal("Partition #:");
Global.mFileSystemDebugger.SendInternal("Partition #: ");
Global.mFileSystemDebugger.SendInternal(i + 1);
global::System.Console.WriteLine("Partition #: " + (i + 1));
Global.mFileSystemDebugger.SendInternal("Block Size:");
Expand Down Expand Up @@ -342,7 +342,7 @@ protected virtual void InitializeFileSystems()
/// <exception cref="Exception">Unable to determine filesystem for path: + aPath</exception>
private FileSystem GetFileSystemFromPath(string aPath)
{
Global.mFileSystemDebugger.SendInternal("CosmosVFS.GetFileSystemFromPath:");
Global.mFileSystemDebugger.SendInternal("--- CosmosVFS.GetFileSystemFromPath ---");

if (String.IsNullOrEmpty(aPath))
{
Expand Down Expand Up @@ -384,7 +384,7 @@ private FileSystem GetFileSystemFromPath(string aPath)
/// <exception cref="Exception">Path part ' + xPathPart + ' not found!</exception>
private DirectoryEntry DoGetDirectoryEntry(string aPath, FileSystem aFS)
{
Global.mFileSystemDebugger.SendInternal("CosmosVFS.DoGetDirectoryEntry:");
Global.mFileSystemDebugger.SendInternal("--- CosmosVFS.DoGetDirectoryEntry ---");

if (String.IsNullOrEmpty(aPath))
{
Expand Down Expand Up @@ -413,8 +413,6 @@ private DirectoryEntry DoGetDirectoryEntry(string aPath, FileSystem aFS)
for (int i = 1; i < xPathParts.Length; i++)
{
var xPathPart = xPathParts[i].ToLower();
Global.mFileSystemDebugger.SendInternal("xPathPart =");
Global.mFileSystemDebugger.SendInternal(xPathPart);

var xPartFound = false;
var xListing = aFS.GetDirectoryListing(xBaseDirectory);
Expand All @@ -424,12 +422,9 @@ private DirectoryEntry DoGetDirectoryEntry(string aPath, FileSystem aFS)
var xListingItem = xListing[j];
string xListingItemName = xListingItem.mName.ToLower();
xPathPart = xPathPart.ToLower();
Global.mFileSystemDebugger.SendInternal("xListingItemName =");
Global.mFileSystemDebugger.SendInternal(xListingItemName);

if (xListingItemName == xPathPart)
{
Global.mFileSystemDebugger.SendInternal("Found path part.");
xBaseDirectory = xListingItem;
xPartFound = true;
}
Expand All @@ -450,7 +445,7 @@ private DirectoryEntry DoGetDirectoryEntry(string aPath, FileSystem aFS)
/// <returns>A directory entry for the volume.</returns>
private DirectoryEntry GetVolume(FileSystem aFS)
{
Global.mFileSystemDebugger.SendInternal("CosmosVFS.GetVolume:");
Global.mFileSystemDebugger.SendInternal("--- CosmosVFS.GetVolume ---");

if (aFS == null)
{
Expand Down
Loading

0 comments on commit 5a26ea5

Please sign in to comment.