Пример #1
0
        public SipperDisk(bool _readDirFromLogFiles)
        {
            BlockStart();

            readDirFromLogFiles = _readDirFromLogFiles;

            openedSipperFiles = new List <SipperDiskFile> ();

            OpenSipperDrive();
            if (fs == null)
            {
                validSipperDrive = false;
                BlockEnd();
                throw new Exception("No SIPPER drive mounted on this system.");
            }

            if (!_readDirFromLogFiles)
            {
                GetListOfSipperFiles();
            }
            else
            {
                String logDirName = PicesSipperVariables.SipperInterfaceLogDir();
                GetListOfSipperFilesFromLogFiles(logDirName);
                //GetListOfSipperFilesFromLogFiles ("D:\\TrainingApp\\SipperInterfaceDir\\LogFiles");
                //GetListOfSipperFilesFromLogFiles ("C:\\Temp\\Temp22");
                //GetListOfSipperFilesFromLogFiles ("C:\\Pices\\SipperInterfaceDir\\LogFiles");
            }

            if ((sipperFiles != null) && (sipperFiles.Count > 0))
            {
                origFirstFileControlBlock = this.sipperFiles[0];
            }

            // We are going to keep the handle to the physical disk close.  If we were to leave it open;
            // it could cause stability issues for the system.  We will open it when ever we need to perform
            // an operation on it.
            CloseHandleToPhysicalDisk();
            BlockEnd();
        }
Пример #2
0
        } /* Dispose */

        public SipperDiskFile  OpenSipperDiskFile(string _fileName)
        {
            BlockStart();
            if (fs == null)
            {
                ReOpen(false);
            }

            SipperFileControlBlock fcb = sipperFiles.LookUpByName(_fileName);

            if (fcb == null)
            {
                return(null);
            }

            SipperDiskFile sipperDiskFile = new SipperDiskFile(fcb, this);

            openedSipperFiles.Add(sipperDiskFile);

            BlockEnd();
            return(sipperDiskFile);
        } /* OpenSipperDiskFile */
Пример #3
0
        } /* OpenSipperDiskFile */

        public SipperDiskFile  OpenSipperDiskFile(int fcbIndex)
        {
            BlockStart();

            if (fs == null)
            {
                ReOpen(false);
            }

            if ((fs == null) || (mbr == null) || (sipperFiles == null))
            {
                BlockEnd();
                return(null);
            }

            if (fcbIndex < 0)
            {
                BlockEnd();
                return(null);
            }

            SipperFileControlBlock fcb = sipperFiles.LookUpByFcbIndex(fcbIndex);

            if (fcb == null)
            {
                BlockEnd();
                return(null);
            }

            SipperDiskFile sipperDiskFile = new SipperDiskFile(fcb, this);

            openedSipperFiles.Add(sipperDiskFile);

            BlockEnd();

            return(sipperDiskFile);
        } /* OpenSipperDiskFile */