Example #1
0
 public override void Read(string path, byte[] buffer, int size)
 {
     lock (ioLock)
     {
         IRailFile val = rail_api.RailFactory().RailStorageHelper().OpenFile(path);
         if (val != null)
         {
             val.Read(buffer, (uint)size);
             val.Close();
         }
     }
 }
Example #2
0
 public override void Read(string path, byte[] buffer, int size)
 {
     lock (this.ioLock)
     {
         IRailFile irailFile = rail_api.RailFactory().RailStorageHelper().OpenFile(path);
         if (irailFile == null)
         {
             return;
         }
         int num = (int)irailFile.Read(buffer, (uint)size);
         irailFile.Close();
     }
 }
Example #3
0
 public override int GetFileSize(string path)
 {
     lock (this.ioLock)
     {
         IRailFile irailFile = rail_api.RailFactory().RailStorageHelper().OpenFile(path);
         if (irailFile == null)
         {
             return(0);
         }
         int size = (int)irailFile.GetSize();
         irailFile.Close();
         return(size);
     }
 }
Example #4
0
 public override int GetFileSize(string path)
 {
     lock (ioLock)
     {
         IRailFile val = rail_api.RailFactory().RailStorageHelper().OpenFile(path);
         if (val != null)
         {
             int size = (int)val.GetSize();
             val.Close();
             return(size);
         }
         return(0);
     }
 }
Example #5
0
 public override bool Write(string path, byte[] data, int length)
 {
     lock (this.ioLock)
     {
         bool      flag      = true;
         IRailFile irailFile = !rail_api.RailFactory().RailStorageHelper().IsFileExist(path) ? rail_api.RailFactory().RailStorageHelper().CreateFile(path) : rail_api.RailFactory().RailStorageHelper().OpenFile(path);
         if (irailFile != null)
         {
             int num = (int)irailFile.Write(data, (uint)length);
             irailFile.Close();
         }
         else
         {
             flag = false;
         }
         return(flag);
     }
 }
Example #6
0
 public override bool Write(string path, byte[] data, int length)
 {
     lock (ioLock)
     {
         bool      result = true;
         IRailFile val    = null;
         val = ((!rail_api.RailFactory().RailStorageHelper().IsFileExist(path)) ? rail_api.RailFactory().RailStorageHelper().CreateFile(path) : rail_api.RailFactory().RailStorageHelper().OpenFile(path));
         if (val != null)
         {
             val.Write(data, (uint)length);
             val.Close();
         }
         else
         {
             result = false;
         }
         return(result);
     }
 }