Пример #1
0
        public int getFileSize(CpmFile file)
        {
            int size = 0;
            FCB fcb  = new FCB( );

            for (int i = 0; i < file.GetFCBCount( ); i++)
            {
                readFCB(file.GetFCBAt(i), fcb);
                int ex     = (fcb.getEX( ) & 0x1f) & ~dpb.exm;
                int record = fcb.getRC( ) & 0xff;
                size = ex * 128 + ((dpb.exm & fcb.getEX( )) + 1) * 128 - (128 - record);
                //System.out.println("name "+file.name+" ext "+ex+" record "+record);
            }

            return(size);
        }
Пример #2
0
        public void deleteFile(int user, String name)
        {
            CpmFile file = searchFileException(user, name);

            for (int i = 0; i < file.GetBlockCount( ); i++)
            {
                //System.out.println("Free block "+file.getBlockAt(i));
                blockUsed[file.GetBlockAt(i)] = false;
            }

            FCB fcb = new FCB( );

            for (int i = 0; i < file.GetFCBCount( ); i++)
            {
                int entry = file.GetFCBAt(i);
                //System.out.println("free FCB "+entry);
                readFCB(entry, fcb);
                fcb.SetDeleted( );
                writeFCB(entry, fcb);
                directoryUsed[entry] = false;
            }

            files.Remove(file);
        }
Пример #3
0
        public int getFileSize(CpmFile file)
        {
            int size = 0;
            FCB fcb = new FCB( );

            for ( int i = 0; i < file.GetFCBCount( ); i++ ) {
                readFCB(file.GetFCBAt(i), fcb);
                int ex = ( fcb.getEX( ) & 0x1f ) & ~dpb.exm;
                int record = fcb.getRC( ) & 0xff;
                size = ex * 128 + ( ( dpb.exm & fcb.getEX( ) ) + 1 ) * 128 - ( 128 - record );
                //System.out.println("name "+file.name+" ext "+ex+" record "+record);
            }

            return size;
        }