コード例 #1
0
ファイル: VFile+.JournalVFile.cs プロジェクト: BclEx/GpuEx
        public string Journal;                  // Name of the journal file

        internal RC CreateFile()
        {
            RC rc = RC.OK;

            if (Real == null)
            {
                VFile        real = null;
                VSystem.OPEN dummy;
                rc = Vfs.Open(Journal, Real, Flags, out dummy);
                if (rc == RC.OK)
                {
                    Real = real;
                    if (Size > 0)
                    {
                        Debug.Assert(Size <= BufferLength);
                        rc = Real.Write(Buffer, Size, 0);
                    }
                    if (rc != RC.OK)
                    {
                        // If an error occurred while writing to the file, close it before returning. This way, SQLite uses the in-memory journal data to
                        // roll back changes made to the internal page-cache before this function was called.
                        Real.Close();
                        Real = null;
                    }
                }
            }
            return(rc);
        }
コード例 #2
0
ファイル: VFile+.JournalVFile.cs プロジェクト: BclEx/GpuEx
 public override RC Close()
 {
     if (Real != null)
     {
         Real.Close();
     }
     Buffer = null;
     return(RC.OK);
 }
コード例 #3
0
ファイル: 25.JournalVFile.cs プロジェクト: BclEx/GpuData
 internal RC CreateFile()
 {
     RC rc = RC.OK;
     if (Real == null)
     {
         VFile real = null;
         VSystem.OPEN dummy;
         rc = Vfs.Open(Journal, Real, Flags, out dummy);
         if (rc == RC.OK)
         {
             Real = real;
             if (Size > 0)
             {
                 Debug.Assert(Size <= BufferLength);
                 rc = Real.Write(Buffer, Size, 0);
             }
             if (rc != RC.OK)
             {
                 // If an error occurred while writing to the file, close it before returning. This way, SQLite uses the in-memory journal data to
                 // roll back changes made to the internal page-cache before this function was called.
                 Real.Close();
                 Real = null;
             }
         }
     }
     return rc;
 }