Copy() публичный Метод

Copies one file to another. The destination file must not exist or an IOException will be thrown.
Source file not found. Destination file already exists. A database error occurred executing the copy function.
public Copy ( String src, String dest ) : void
src String
dest String
Результат void
Пример #1
0
 public void TestCopy(){
     GridFile fs = new GridFile(DB, "gfcopy");
     GridFileStream gfs = fs.Create("original.txt");
     gfs.WriteByte(1);
     gfs.Seek(1024 * 256 * 2, SeekOrigin.Begin);
     gfs.WriteByte(2);
     gfs.Close();
     fs.Copy("original.txt", "copy.txt");
     Assert.IsTrue(fs.Exists("original.txt"));
     Assert.IsTrue(fs.Exists("copy.txt"));
     //TODO Assert chunk data is the same too.
 }
Пример #2
0
        public void TestCopy()
        {
            GridFile       fs  = new GridFile(db["tests"], "gfcopy");
            GridFileStream gfs = fs.Create("original.txt");

            gfs.WriteByte(1);
            gfs.Seek(1024 * 256 * 2, SeekOrigin.Begin);
            gfs.WriteByte(2);
            gfs.Close();
            fs.Copy("original.txt", "copy.txt");
            Assert.IsTrue(fs.Exists("original.txt"));
            Assert.IsTrue(fs.Exists("copy.txt"));
            //TODO Assert chunk data is the same too.
        }