Closed COR-ET closed 9 months ago
Can you please provide more precise reproduction steps? For example, a example kernel + vmdk file.
The tests in https://github.com/CosmosOS/Cosmos/blob/master/Tests/Kernels/Cosmos.Kernel.Tests.Fat/System.IO/DirectoryTest.cs#L82 work, so there must be some important differences.
here is my mkdir
code :
case "mkdir":
if (arguments.Length == 1)
{
var directory = arguments[0];
Console.WriteLine("Creating directory {0}", @directory);
var xDirectory = Directory.CreateDirectory(@"0:\test2");
Console.WriteLine("Created !");
break;
}
else
{
Console.WriteLine("Usage: mkdir <directory>");
}
break;
and here is my Pre-Load of FileSystem ( some messed stuff :> ) :
try { VFSManager.RegisterVFS(fs); } catch (Exception ex) { ReturnExp(ex); /*Console.WriteLine(" Failed in VFS Register"); */}
try { FatFileSystemFactory fat = new FatFileSystemFactory(); Sys.FileSystem.VFS.FileSystemManager.Register(fat); } catch (Exception ex) { ReturnExp(ex); /*Console.WriteLine("Failed in FAT Register"); */}
try { fs.GetDisks().ForEach(disk => { if (disk.Type == BlockDeviceType.HardDrive) { disk.Mount(); /*disk.MountPartition(0);*/ } }); } catch (Exception ex) { ReturnExp(ex); Console.WriteLine("fs Mount Failed !"); }
try {
foreach (var drive in DriveInfo.GetDrives()) {
DriveFormat = drive.DriveFormat;
Console.WriteLine("Drive {0} ({1})", drive.Name, drive.VolumeLabel);
Console.WriteLine(" File system: {0}", drive.DriveFormat);
Console.WriteLine(" Total size : {0} bytes", drive.TotalSize);
Console.WriteLine(" Free space : {0} bytes", drive.AvailableFreeSpace);
if (DriveFormat.Contains("FAT")) { SupportedDisk = true; } else { SupportedDisk = false; }
}
}
catch (Exception ex ) { ReturnExp(ex); }
but here is the OS result :
and the file in real is empty , checked in explorer :
@quajak
Why are you trying to use the FS factory? That's only meant to make new FS drivers
Your code is way over complicated. You are suposed to register fs
, not a new file systme factory. Please actually read documentation before assuming whatever you do will work
Check this :
Area of Cosmos - What area of Cosmos are we dealing with?
FileSystem (and working with System.IO for File and Directory)
Expected Behaviour - What do you think that should happen?
Creating a Directory when using
Directory.CreateDirectory(...)
, orFile.Create
, !! ( for now , only showing Directories works fine , and the cd command too forSetCurrentDirectory
andGetCurrentDirectory
) !!Actual Behaviour - What unexpectedly happens?
on first time , it wasn't even responding , System is not responding , even tho I have Exception Handler , now it shows (Directory created) , but there is no new directory . !! ( i tried on VHD on VBox , and on real HDD (USB disk FAT32 type added into VBox) , and even on Cosmos FileSystem VMDK ) ) !!
Reproduction - How did you get this error to appear?
as I said , its not an exception , there is no reason given for the error
Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?
ofc Devkit , userkit is outdated i think , IL2CPU must be latest , as same for X#
for more details or info requests , resume contact with me in this thread !
Sorry for my Enjlish ._.