mirror of
https://github.com/tonytins/tomas.git
synced 2025-06-25 10:04:43 -04:00
Switched to BSD 3-Cluase license
- Use global usings in main kernal project
This commit is contained in:
parent
7c16857c9a
commit
7b47f7afd8
17 changed files with 217 additions and 819 deletions
|
@ -1,4 +1,4 @@
|
|||
// I license this project under the GPL 3.0 license.
|
||||
// I license this project under the BSD 3-Clause license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using System;
|
||||
using System.IO;
|
||||
|
@ -8,45 +8,45 @@ using Tomas.Common;
|
|||
|
||||
namespace Tomas.Kernel
|
||||
{
|
||||
class TomFS
|
||||
{
|
||||
public const string ROOT_DIR = "0:\\";
|
||||
public static string SYSTEM_DIR = $"{ROOT_DIR}\\SYSTEM\\";
|
||||
class TomFS
|
||||
{
|
||||
public const string ROOT_DIR = "0:\\";
|
||||
public static string SYSTEM_DIR = $"{ROOT_DIR}\\SYSTEM\\";
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
var fs = new CosmosVFS();
|
||||
VFSManager.RegisterVFS(fs);
|
||||
fs.CreateDirectory(SYSTEM_DIR);
|
||||
Console.WriteLine("Creating system files.");
|
||||
fs.CreateFile($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine("Setting system preferences.");
|
||||
File.WriteAllText($"{SYSTEM_DIR}sysinfo.txt", $"{ComConsts.NAME}, {ComConsts.VersionGit}");
|
||||
Console.WriteLine("File system loaded sucesfully.");
|
||||
var intro = File.ReadAllText($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine(intro);
|
||||
public static void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
var fs = new CosmosVFS();
|
||||
VFSManager.RegisterVFS(fs);
|
||||
fs.CreateDirectory(SYSTEM_DIR);
|
||||
Console.WriteLine("Creating system files.");
|
||||
fs.CreateFile($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine("Setting system preferences.");
|
||||
File.WriteAllText($"{SYSTEM_DIR}sysinfo.txt", $"{ComConsts.NAME}, {ComConsts.VersionGit}");
|
||||
Console.WriteLine("File system loaded sucesfully.");
|
||||
var intro = File.ReadAllText($"{SYSTEM_DIR}sysinfo.txt");
|
||||
Console.WriteLine(intro);
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("File system failed to load! Not all functions will work.");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("File system failed to load! Not all functions will work.");
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] ListDirectories(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dirs = Directory.GetDirectories(path);
|
||||
return dirs;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Failed to find any directories.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static string[] ListDirectories(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var dirs = Directory.GetDirectories(path);
|
||||
return dirs;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Console.WriteLine("Failed to find any directories.");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue