mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-22 13:58:47 +00:00
- Added tests for FileInfo - Added tests for Binary Reader/Writer - Unified StreamReader and StreamWriter in a unique test
29 lines
860 B
C#
29 lines
860 B
C#
#define COSMOSDEBUG
|
|
using System.IO;
|
|
using Cosmos.IL2CPU.API.Attribs;
|
|
using Cosmos.System;
|
|
using Cosmos.System.FileSystem.Listing;
|
|
using Cosmos.System.FileSystem.VFS;
|
|
|
|
namespace Cosmos.System2_Plugs.System.IO
|
|
{
|
|
[Plug(Target = typeof(FileInfo))]
|
|
public static class FileInfoImpl
|
|
{
|
|
public static bool get_Exists(FileInfo aThis)
|
|
{
|
|
string aPath = aThis.FullName;
|
|
Global.mFileSystemDebugger.SendInternal($"FileInfo.Exists : aPath = {aPath}");
|
|
return VFSManager.FileExists(aPath);
|
|
}
|
|
|
|
/* Optimize this: CosmosVFS should expose an attribute without the need to open the file for reading... */
|
|
public static long get_Length(FileInfo aThis)
|
|
{
|
|
using (var xFs = aThis.OpenRead())
|
|
{
|
|
return xFs.Length;
|
|
}
|
|
}
|
|
}
|
|
}
|