public void CaseSensitiveFileSearch()
        {
            string fileName = "caseSensitiveFile.gpg";
            string caseSensitiveFile = Application.LocalUserAppDataPath + "\\" + fileName;
            try
            {
                FileInfo fileInfo = new FileInfo(caseSensitiveFile);
                using (File.Create(Path.Combine(caseSensitiveFile)))
                {
                }

                FileSystemInterface fsi = new FileSystemInterface(Application.LocalUserAppDataPath);
                fsi.Search(fileName.ToLower());

                Assert.AreEqual(1, fsi.SearchList.Count);
                foreach (var row in fsi.SearchList)
                {
                    Assert.IsNotNull(row);
                    FileInfo tmpFileInfo = new FileInfo(row);
                    Assert.True(tmpFileInfo.Exists);
                }
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
            finally
            {
                File.Delete(caseSensitiveFile);
            }
        }
 public void FileSearch()
 {
     FileSystemInterface fsi = new FileSystemInterface(Application.LocalUserAppDataPath);
     fsi.Search("*.*");
     foreach (var row in fsi.SearchList)
     {
         Assert.IsNotNull(row);
         FileInfo tmpFileInfo = new FileInfo(row);
         Assert.True(tmpFileInfo.Exists);
     }
 }
 public void FileTest()
 {
     FileSystemInterface fsi = new FileSystemInterface(Application.LocalUserAppDataPath);
     var myList = fsi.UpdateDirectoryList(new DirectoryInfo(Application.LocalUserAppDataPath));
     foreach (var row in myList)
     {
         Assert.IsNotNull(row);
         FileInfo tmpFileInfo = new FileInfo(row);
         Assert.True(tmpFileInfo.Exists);
     }
 }
        public virtual void TestReadWrite()
        {
            DeleteBase("testReadWrite.ndb");
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testReadWrite.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(fsi.GetLength(), false);
            for (var i = 0; i < 10000; i++)
            {
                fsi.WriteInt(i, false);
                var currentPosition = fsi.GetPosition();
                if (i == 8000)
                {
                    currentPosition = fsi.GetPosition();

                    // Using the for transaction method to avoid protected area
                    // verification, check the setWritePosition method
                    fsi.SetWritePositionNoVerification(4, false);
                    AssertEquals(1, fsi.ReadInt());

                    fsi.SetWritePositionNoVerification(currentPosition, false);
                }
                if (i == 9000)
                {
                    currentPosition = fsi.GetPosition();

                    fsi.SetWritePositionNoVerification(8, false);
                    fsi.WriteInt(12, false);

                    fsi.SetWritePositionNoVerification(currentPosition, false);
                }
            }
            fsi.SetReadPosition(0);
            for (var i = 0; i < 10000; i++)
            {
                var j = fsi.ReadInt();
                if (i == 2)
                {
                    AssertEquals(12, j);
                }
                else
                {
                    AssertEquals(i, j);
                }
            }
            fsi.Close();
            DeleteBase("testReadWrite.ndb");
        }
Exemplo n.º 5
0
 public virtual void TestBigInteger()
 {
     DeleteBase("testBigDecimal.ndb");
     var bd = Convert.ToDecimal("-128451");
     IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testBigDecimal.ndb"),
                                                        MultiBuffer.DefaultBufferSizeForData,
                                                        new MockSession("test"));
     fsi.SetWritePosition(0, false);
     fsi.WriteBigDecimal(bd, false);
     fsi.Close();
     fsi = new FileSystemInterface(new FileIdentification("testBigDecimal.ndb"),
                                   MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
     fsi.SetReadPosition(0);
     var bd2 = fsi.ReadBigDecimal();
     AssertEquals(bd, bd2);
     fsi.Close();
 }
Exemplo n.º 6
0
        public virtual void TestByte()
        {
            DeleteBase("testByte.ndb");

            const byte b = 127;
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testByte.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));
            fsi.SetWritePosition(0, false);
            fsi.WriteByte(b, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testByte.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var b2 = fsi.ReadByte();
            AssertEquals(b, b2);
            fsi.Close();
        }
Exemplo n.º 7
0
 public virtual void TestReadWrite()
 {
     DeleteBase("testReadWrite.ndb");
     IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testReadWrite.ndb"),
                                                        MultiBuffer.DefaultBufferSizeForData,
                                                        new MockSession("test"));
     fsi.SetWritePosition(fsi.GetLength(), false);
     for (var i = 0; i < 10000; i++)
     {
         fsi.WriteInt(i, false);
         var currentPosition = fsi.GetPosition();
         if (i == 8000)
         {
             currentPosition = fsi.GetPosition();
             
             // Using the for transaction method to avoid protected area
             // verification, check the setWritePosition method
             fsi.SetWritePositionNoVerification(4, false);
             AssertEquals(1, fsi.ReadInt());
             
             fsi.SetWritePositionNoVerification(currentPosition, false);
         }
         if (i == 9000)
         {
             currentPosition = fsi.GetPosition();
             
             fsi.SetWritePositionNoVerification(8, false);
             fsi.WriteInt(12, false);
             
             fsi.SetWritePositionNoVerification(currentPosition, false);
         }
     }
     fsi.SetReadPosition(0);
     for (var i = 0; i < 10000; i++)
     {
         var j = fsi.ReadInt();
         if (i == 2)
             AssertEquals(12, j);
         else
             AssertEquals(i, j);
     }
     fsi.Close();
     DeleteBase("testReadWrite.ndb");
 }
        public virtual void TestBigInteger()
        {
            DeleteBase("testBigDecimal.ndb");
            var bd = Convert.ToDecimal("-128451");
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testBigDecimal.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteBigDecimal(bd, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testBigDecimal.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var bd2 = fsi.ReadBigDecimal();

            AssertEquals(bd, bd2);
            fsi.Close();
        }
        public virtual void TestFloat()
        {
            DeleteBase("testFloat.ndb");
            const float          f   = (float)12544548.12454;
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testFloat.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteFloat(f, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testFloat.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var f2 = fsi.ReadFloat();

            AssertTrue(f == f2);
            fsi.Close();
        }
Exemplo n.º 10
0
        public virtual void TestString()
        {
            var                  baseName = GetBaseName();
            const string         s        = "ola chico, como você está ??? eu estou bem até amanhã de manhã, áááá'";
            IFileSystemInterface fsi      = new FileSystemInterface(new FileIdentification(baseName),
                                                                    MultiBuffer.DefaultBufferSizeForData,
                                                                    new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteString(s, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification(baseName), MultiBuffer.DefaultBufferSizeForData,
                                          new MockSession("test"));
            fsi.SetReadPosition(0);
            var s2 = fsi.ReadString();

            fsi.Close();
            AssertEquals(s, s2);
        }
Exemplo n.º 11
0
        public virtual void TestLong()
        {
            DeleteBase("testLong.ndb");
            const long           i   = 259999865;
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testLong.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteLong(i, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testLong.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var i2 = fsi.ReadLong();

            AssertEquals(i, i2);
            fsi.Close();
        }
Exemplo n.º 12
0
        public virtual void TestShort()
        {
            DeleteBase("testShort.ndb");
            const short          s   = 4598;
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testShort.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteShort(s, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testShort.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var s2 = fsi.ReadShort();

            AssertEquals(s, s2);
            fsi.Close();
        }
Exemplo n.º 13
0
        public virtual void TestByte()
        {
            DeleteBase("testByte.ndb");

            const byte           b   = 127;
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testByte.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteByte(b, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testByte.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var b2 = fsi.ReadByte();

            AssertEquals(b, b2);
            fsi.Close();
        }
Exemplo n.º 14
0
        public virtual void TestChar()
        {
            DeleteBase("testChar.ndb");

            const char           c   = '\u00E1';
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testChar.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteChar(c, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testChar.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var c2 = fsi.ReadChar();

            AssertEquals(c, c2);
            fsi.Close();
        }
Exemplo n.º 15
0
        public virtual void TestBoolean()
        {
            DeleteBase("testBoolean.ndb");

            const bool b1 = true;
            const bool b2 = false;
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testBoolean.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));
            fsi.SetWritePosition(0, false);
            fsi.WriteBoolean(b1, false);
            fsi.WriteBoolean(b2, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testBoolean.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var b11 = fsi.ReadBoolean();
            var b22 = fsi.ReadBoolean();
            AssertEquals(b1, b11);
            AssertEquals(b2, b22);
            fsi.Close();
        }
Exemplo n.º 16
0
        public virtual void TestBoolean()
        {
            DeleteBase("testBoolean.ndb");

            const bool           b1  = true;
            const bool           b2  = false;
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testBoolean.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));

            fsi.SetWritePosition(0, false);
            fsi.WriteBoolean(b1, false);
            fsi.WriteBoolean(b2, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testBoolean.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var b11 = fsi.ReadBoolean();
            var b22 = fsi.ReadBoolean();

            AssertEquals(b1, b11);
            AssertEquals(b2, b22);
            fsi.Close();
        }
Exemplo n.º 17
0
 /// <summary>
 /// 新しいフォルダーを作成
 /// </summary>
 /// <param name="folderPath">フォルダーパス</param>
 /// <returns></returns>
 public static int FolderCreate(string folderPath)
 {
     return(FileSystemInterface.FolderCreate(folderPath));
 }
Exemplo n.º 18
0
 /// <summary>
 /// 新しいファイルを作成
 /// </summary>
 /// <param name="filePath">ファイルパス</param>
 /// <returns></returns>
 public static int FileCreate(string filePath)
 {
     return(FileSystemInterface.FileCreate(filePath));
 }
Exemplo n.º 19
0
 /// <summary>
 /// 末尾にテキストを書き込む
 /// </summary>
 /// <param name="path">ファイルパス</param>
 /// <param name="text">書き込みしたいテキスト</param>
 /// <param name="parm">true -> 既存テキストを残したまま末尾に追加<br/>false -> 既存テキストを抹消した後に追加</param>
 /// <param name="enc">エンコード指定(未指定でも可)<br/>UTF-8が指定された場合はBOM付きになる</param>
 /// <returns></returns>
 public static int FileWrite(string path, string text, bool parm, Encoding enc = null)
 {
     return(FileSystemInterface.FileWrite(path, text, parm, enc));
 }
Exemplo n.º 20
0
 public void DirectoryTest()
 {
     FileSystemInterface fsi = new FileSystemInterface(Application.LocalUserAppDataPath);
     TreeNode[] nodes = fsi.UpdateDirectoryTree(new DirectoryInfo(Application.LocalUserAppDataPath));
     Assert.IsNotNull(nodes);
 }
Exemplo n.º 21
0
        public virtual void TestChar()
        {
            DeleteBase("testChar.ndb");

            const char c = '\u00E1';
            IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testChar.ndb"),
                                                               MultiBuffer.DefaultBufferSizeForData,
                                                               new MockSession("test"));
            fsi.SetWritePosition(0, false);
            fsi.WriteChar(c, false);
            fsi.Close();
            fsi = new FileSystemInterface(new FileIdentification("testChar.ndb"),
                                          MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
            fsi.SetReadPosition(0);
            var c2 = fsi.ReadChar();
            AssertEquals(c, c2);
            fsi.Close();
        }
Exemplo n.º 22
0
 public virtual void TestFloat()
 {
     DeleteBase("testFloat.ndb");
     const float f = (float) 12544548.12454;
     IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testFloat.ndb"),
                                                        MultiBuffer.DefaultBufferSizeForData,
                                                        new MockSession("test"));
     fsi.SetWritePosition(0, false);
     fsi.WriteFloat(f, false);
     fsi.Close();
     fsi = new FileSystemInterface(new FileIdentification("testFloat.ndb"),
                                   MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
     fsi.SetReadPosition(0);
     var f2 = fsi.ReadFloat();
     AssertTrue(f == f2);
     fsi.Close();
 }
Exemplo n.º 23
0
 public virtual void TestShort()
 {
     DeleteBase("testShort.ndb");
     const short s = 4598;
     IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testShort.ndb"),
                                                        MultiBuffer.DefaultBufferSizeForData,
                                                        new MockSession("test"));
     fsi.SetWritePosition(0, false);
     fsi.WriteShort(s, false);
     fsi.Close();
     fsi = new FileSystemInterface(new FileIdentification("testShort.ndb"),
                                   MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
     fsi.SetReadPosition(0);
     var s2 = fsi.ReadShort();
     AssertEquals(s, s2);
     fsi.Close();
 }
Exemplo n.º 24
0
        // FileSystemInterface.cs

        /// <summary>
        /// ファイルをコピー
        /// </summary>
        /// <param name="source">コピー元ファイルパス</param>
        /// <param name="dest">コピー先ファイルパス</param>
        public static int FileCopy(string source, string dest)
        {
            return(FileSystemInterface.FileCopy(source, dest));
        }
Exemplo n.º 25
0
        static int Main(string[] commandArgs)
        {
            int returnValue = 0;

            try {
                if (commandArgs.Length < 1)   //error, no arg. supplied
                {
                    string errMsg = "No argument supplied.\n";
                    errMsg += "\tUsage: " + Process.GetCurrentProcess().ProcessName + " <Build Import Manifest>\n";
                    errMsg += "\tFor example, " + Process.GetCurrentProcess().ProcessName + " BuildImports.xml";
                    throw new Exception(errMsg);
                }
                if (!File.Exists(commandArgs[0]))
                {
                    throw new Exception("File not found: " + commandArgs[0]);
                }
                //Get build attributes. Note: This module always expects q:\ to be mapped to the build path by
                //LibraryBuilder prior to invocation.
                LibraryManifest     currManifest        = new LibraryManifest(LBEnvironment.BuildMapDrive);
                string              buildDefinitionFile = ProductBuildDataSet.GetBuildConfigurationFilename(LBEnvironment.BuildMapDrive);
                ProductBuildDataSet pbDataSet           = ProductBuildDataSet.ReadBuildConfigurationFile(buildDefinitionFile);
                string              buildProfile        = pbDataSet.GetBuildProperty("BuildProfileName");

                //Parse the xml file.
                XmlDocument xmlManifestDoc = new XmlDocument();
                xmlManifestDoc.Load(commandArgs[0]);
                //file may or may not contain version info
                XmlNode versionNode = xmlManifestDoc.DocumentElement.Attributes.GetNamedItem("version");
                int     fileVersion = (versionNode == null)? 1 : int.Parse(versionNode.InnerText);
                //version 3 or higher is implemented in LB and uses zip file implementation
                if (fileVersion >= 3)
                {
                    FileSystemInterface.ValidateComponentImportStep(LBEnvironment.BuildMapDrive,
                                                                    currManifest.GetBranchOrTrunkName(),
                                                                    commandArgs[0], false, true, false);
                }
                else
                {
                    foreach (XmlNode importNode in xmlManifestDoc.DocumentElement.ChildNodes)
                    {
                        if (importNode.NodeType != XmlNodeType.Comment)
                        {
                            string prodName           = importNode.Attributes["sourceProduct"].InnerText;
                            string prodVer            = importNode.Attributes["sourceVersion"].InnerText;
                            string platCode           = importNode.Attributes["sourcePlatform"].InnerText;
                            string branchOrTrunkName  = importNode.Attributes["sourceBranchOrTrunkName"].InnerText;
                            string itemToCopy         = importNode.SelectSingleNode("source").Attributes["path"].InnerText;
                            string destPath           = importNode.SelectSingleNode("destination").Attributes["path"].InnerText;;
                            bool   copySubdirectories = false;
                            bool   cleanAtDestination = false;
                            if (fileVersion > 1)
                            {
                                copySubdirectories = bool.Parse(importNode.SelectSingleNode("source").Attributes["copySubDirectories"].InnerText.ToLower());
                                cleanAtDestination = bool.Parse(importNode.SelectSingleNode("source").Attributes["cleanDestination"].InnerText.ToLower());
                            }

                            //Trim spaces and path characters
                            itemToCopy = itemToCopy.Trim(new char[] { ' ', '\\', '/' });
                            destPath   = destPath.Trim(new char[] { ' ', '\\', '/' });

                            string productPath = LBEnvironment.NetworkProductRootDir + "\\" + prodName + "\\V" + prodVer.Replace(".", "_") + "." + platCode;
                            if (!Directory.Exists(productPath))
                            {
                                throw new Exception("Product directory not found: " + productPath);
                            }

                            //Compute and identify - directory, file or wildcard - what to copy. Compute the destination as well.
                            // Also indicate whether listed path exists.
                            string       sourceFullPath          = productPath + "\\" + branchOrTrunkName + "\\" + itemToCopy;;
                            string       destFullpath            = Path.Combine(LBEnvironment.BuildMapDrive, destPath);
                            string       alternateSourceFullPath = productPath + "\\" + "DEVELOP" + "\\" + itemToCopy;;
                            bool         usingAlternateCopyPath  = false;
                            CopyItemType copyItemType            = CopyItemType.UNIDENTIFIED;
                            if (itemToCopy.IndexOf("*") > 1)
                            {
                                copyItemType = CopyItemType.WILDCARD;
                                if (!Directory.Exists(Path.GetDirectoryName(sourceFullPath)))
                                {
                                    usingAlternateCopyPath  = true;
                                    alternateSourceFullPath = productPath + "\\" + "DEVELOP" + "\\" + itemToCopy;
                                }
                            }
                            else if (Directory.Exists(sourceFullPath))
                            {
                                copyItemType = CopyItemType.DIRECTORY;
                            }
                            else if (Directory.Exists(alternateSourceFullPath))
                            {
                                copyItemType           = CopyItemType.DIRECTORY;
                                usingAlternateCopyPath = true;
                            }
                            else if (File.Exists(sourceFullPath))
                            {
                                copyItemType = CopyItemType.FILE;
                            }
                            else if (File.Exists(alternateSourceFullPath))
                            {
                                copyItemType           = CopyItemType.FILE;
                                usingAlternateCopyPath = true;
                            }
                            else   //Listed path not valid
                            {
                                throw new Exception("Unable to find import source: " + sourceFullPath);
                            }
                            //Create the destination directory
                            Directory.CreateDirectory(destFullpath);

                            //For QA profiles or non-DEVELOP builds, a build must fail if a listed path cannot be found. Accept no substitutes:
                            //A listed path must not be from DEVELOP, PREPROD, PROD or CANDIDATE and it must exist
                            if (buildProfile.ToUpper().StartsWith("QA") || (currManifest.GetBranchOrTrunkName().ToUpper() != "DEVELOP"))
                            {
                                if ((branchOrTrunkName.ToUpper() == "DEVELOP") || (branchOrTrunkName.ToUpper() == "CANDIDATE") ||
                                    (branchOrTrunkName.ToUpper() == "PREPROD") || (branchOrTrunkName.ToUpper() == "PROD") ||
                                    (branchOrTrunkName.ToUpper() == "STABLE"))
                                {
                                    string errMsg = "Cannot build QA level library or profile without a branch library import source. ";
                                    errMsg += "Please check your entry in " + commandArgs[0] + " for ";
                                    errMsg += prodName + " " + prodVer + " " + platCode + " " + branchOrTrunkName;
                                    throw new Exception(errMsg);
                                }
                                if (usingAlternateCopyPath)
                                {
                                    throw new Exception("Unable to find import source: " + sourceFullPath);
                                }
                            }

                            string sourceItem = (usingAlternateCopyPath)? alternateSourceFullPath : sourceFullPath;
                            //If copying a directory add a wildcard
                            if (copyItemType == CopyItemType.DIRECTORY)
                            {
                                sourceItem = Path.Combine(sourceItem, "*.*");
                            }
                            //if clean copy was requested, delete source files' paths at destination
                            if (cleanAtDestination && Directory.Exists(destFullpath))
                            {
                                ImportComponents.DeleteFiles(Path.Combine(destFullpath, Path.GetFileName(sourceItem)), copySubdirectories);
                            }

                            returnValue = ImportComponents.XCopyDirToQDrive(sourceItem, destFullpath, copySubdirectories);
                            if (returnValue != 0)
                            {
                                throw new Exception("xcopy returned an error(" + returnValue.ToString() + ") while copying " + sourceItem + " to " + destFullpath);
                            }
                        }
                    }//foreach
                }
            }
            catch (Exception currExcept) {
                Console.WriteLine("Error occurred during build import: " + currExcept.Message);
                if (returnValue == 0)
                {
                    returnValue = 1;
                }
            }
            return(returnValue);
        }
Exemplo n.º 26
0
 public virtual void TestLong()
 {
     DeleteBase("testLong.ndb");
     const long i = 259999865;
     IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification("testLong.ndb"),
                                                        MultiBuffer.DefaultBufferSizeForData,
                                                        new MockSession("test"));
     fsi.SetWritePosition(0, false);
     fsi.WriteLong(i, false);
     fsi.Close();
     fsi = new FileSystemInterface(new FileIdentification("testLong.ndb"),
                                   MultiBuffer.DefaultBufferSizeForData, new MockSession("test"));
     fsi.SetReadPosition(0);
     var i2 = fsi.ReadLong();
     AssertEquals(i, i2);
     fsi.Close();
 }
Exemplo n.º 27
0
 public virtual void TestString()
 {
     var baseName = GetBaseName();
     const string s = "ola chico, como você está ??? eu estou bem até amanhã de manhã, áááá'";
     IFileSystemInterface fsi = new FileSystemInterface(new FileIdentification(baseName),
                                                        MultiBuffer.DefaultBufferSizeForData,
                                                        new MockSession("test"));
     fsi.SetWritePosition(0, false);
     fsi.WriteString(s, false);
     fsi.Close();
     fsi = new FileSystemInterface(new FileIdentification(baseName), MultiBuffer.DefaultBufferSizeForData,
                                   new MockSession("test"));
     fsi.SetReadPosition(0);
     var s2 = fsi.ReadString();
     fsi.Close();
     AssertEquals(s, s2);
 }