public unsafe void _IoGetstat(IsoNode IsoNode, SceIoStat *Stat) { //IsoNode.DirectoryRecord.Date Stat->Mode = 0; Stat->Mode |= SceMode.UserCanRead | SceMode.UserCanWrite | SceMode.UserCanExecute; Stat->Mode |= SceMode.GroupCanRead | SceMode.GroupCanWrite | SceMode.GroupCanExecute; Stat->Mode |= SceMode.OtherCanRead | SceMode.OtherCanWrite | SceMode.OtherCanExecute; if (IsoNode.IsDirectory) { Stat->Mode = SceMode.Directory; Stat->Attributes = IOFileModes.Directory; } else { Stat->Mode = SceMode.File; Stat->Attributes = IOFileModes.File | IOFileModes.CanRead | IOFileModes.CanWrite | IOFileModes.CanExecute; } Stat->Size = IsoNode.DirectoryRecord.Size; Stat->TimeCreation = ScePspDateTime.FromDateTime(IsoNode.DirectoryRecord.Date); Stat->TimeLastAccess = ScePspDateTime.FromDateTime(IsoNode.DirectoryRecord.Date); Stat->TimeLastModification = ScePspDateTime.FromDateTime(IsoNode.DirectoryRecord.Date); Stat->DeviceDependentData0 = IsoNode.DirectoryRecord.Extent; //Stat[0].DeviceDependentData //throw new NotImplementedException(); }
public static unsafe HleIoDirent ConvertFileSystemInfoToHleIoDirent(FileSystemInfo FileSystemInfo) { var HleIoDirent = default(HleIoDirent); var FileInfo = (FileSystemInfo as FileInfo); var DirectoryInfo = (FileSystemInfo as DirectoryInfo); { if (DirectoryInfo != null) { HleIoDirent.Stat.Size = 4096; HleIoDirent.Stat.Mode = (SceMode)4605; HleIoDirent.Stat.Attributes = IOFileModes.Directory; } else { HleIoDirent.Stat.Size = FileInfo.Length; HleIoDirent.Stat.Mode = (SceMode)8628; HleIoDirent.Stat.Attributes = IOFileModes.File; } HleIoDirent.Name = FileSystemInfo.Name.ToLower(); HleIoDirent.Stat.TimeCreation = ScePspDateTime.FromDateTime(FileSystemInfo.CreationTime); HleIoDirent.Stat.TimeLastAccess = ScePspDateTime.FromDateTime(FileSystemInfo.LastAccessTime); HleIoDirent.Stat.TimeLastModification = ScePspDateTime.FromDateTime(FileSystemInfo.LastWriteTime); HleIoDirent.Stat.DeviceDependentData0 = 10; } return(HleIoDirent); }
public int sceRtcSetTick(ScePspDateTime *Date, ulong *Ticks) { try { *Date = ScePspDateTime.FromDateTime(new DateTime((long)(*Ticks * 10))); return(0); } catch (Exception Exception) { Console.Error.WriteLine(Exception); return(-1); } }
public unsafe int IoGetstat(HleIoDrvFileArg HleIoDrvFileArg, string FileName, SceIoStat *Stat) { var RealFileName = GetFullNormalizedAndSanitizedPath(FileName); //Console.WriteLine(RealFileName); Stat->Attributes = IOFileModes.CanExecute | IOFileModes.CanRead | IOFileModes.CanWrite; Stat->Mode = 0; Stat->Mode = SceMode.UserCanExecute | SceMode.UserCanRead | SceMode.UserCanWrite; Stat->Mode = SceMode.GroupCanExecute | SceMode.GroupCanRead | SceMode.GroupCanWrite; Stat->Mode = SceMode.OtherCanExecute | SceMode.OtherCanRead | SceMode.OtherCanWrite; FileSystemInfo FileSystemInfo = null; if (File.Exists(RealFileName)) { var FileInfo = new FileInfo(RealFileName); FileSystemInfo = FileInfo; Stat->Size = FileInfo.Length; Stat->Mode |= SceMode.File; Stat->Attributes |= IOFileModes.File; } else if (Directory.Exists(RealFileName)) { var DirectoryInfo = new DirectoryInfo(RealFileName); FileSystemInfo = DirectoryInfo; Stat->Mode |= SceMode.Directory; Stat->Attributes |= IOFileModes.Directory; } else { throw(new FileNotFoundException("Can't find file '" + RealFileName + "'")); } Stat->TimeCreation = ScePspDateTime.FromDateTime(FileSystemInfo.CreationTimeUtc); Stat->TimeLastAccess = ScePspDateTime.FromDateTime(FileSystemInfo.LastAccessTimeUtc); Stat->TimeLastModification = ScePspDateTime.FromDateTime(FileSystemInfo.LastWriteTimeUtc); return(0); }
public int sceRtcSetTime_t(out ScePspDateTime date, uint time) { date = ScePspDateTime.FromDateTime(DateTimeRange.ConvertFromUnixTimestamp(time)); return(0); }