Пример #1
0
 public static void SetArrayInodeDirTable(int index, byte value)
 {
     arrayInodeDirTable[index] = value;
     HardDisk.Write(new byte[1] {
         value
     }, SuperBlock.InodeDirTableStart + index);
 }
Пример #2
0
 public static void SetArrayBlock(int index, byte value)
 {
     arrayBlock[index] = value;
     HardDisk.Write(new byte[1] {
         value
     }, SuperBlock.FSMStart + index);
 }
Пример #3
0
        public static void SetInodeID(string name, int ID)
        {
            byte[] buffer = System.Text.Encoding.ASCII.GetBytes(name);
            HardDisk.Write(buffer, SuperBlock.InodeNameAndIDTableStart + ID * SuperBlock.InodeNameLength);

            nameInode[ID] = name;
        }
Пример #4
0
        public void SetArrayFile(int index, int number)
        {
            byte[] buffer = new byte[4];
            buffer = BitConverter.GetBytes(SuperBlock.InodeStart + SuperBlock.InodeSize * number);
            HardDisk.Write(buffer, SuperBlock.InodeDirStart + dirID * SuperBlock.InodeDirSize + 4 * index);

            arrayFile[index] = SuperBlock.InodeStart + SuperBlock.InodeSize * number;
        }
Пример #5
0
        public void SetArrayBlock(int index, int number)
        {
            byte[] buffer = new byte[4];
            buffer = BitConverter.GetBytes(number * SuperBlock.BlockSize + SuperBlock.BlockStart);

            HardDisk.Write(buffer, SuperBlock.InodeStart + fileID * SuperBlock.InodeSize + 4 * index);

            arrayBlocks[index] = number * SuperBlock.BlockSize + SuperBlock.BlockStart;
        }