FileSystemSimulation-master
文件 

所属分类:Windows编程
开发工具:C/C++
文件大小:78KB
下载次数:0
上传日期:2020-06-25 17:28:07
上 传 者JohnChiu
说明:  模拟文件系统 C++语言实现 模拟linux文件的操作
(Simulation file system)

文件列表:
LICENSE (11357, 2017-12-31)
res (0, 2017-12-31)
res\roadmap.jpg (206877, 2017-12-31)
src (0, 2017-12-31)
src\main.cpp (6444, 2017-12-31)
src\OSFS.cpp (26817, 2017-12-31)
src\OSFS.hpp (4968, 2017-12-31)

# Roadmap ![roadmap](https://github.com/sunnymeow/FileSystemSimulation/blob/master/res/roadmap.jpg) # Commands Each command that may be processed by the file system is matched by an input command line. The syntax of these command lines, and the processing to be performed, is as follows: * CREATE type name >"type" is either U or D, and indicates whether a User data file or a Directory file is to be created. "name" is a full file name in the form described above.
Neither of these items is enclosed in quotes. The **CREATE** command should cause a new directory entry to be created for the type of file specified. If **CREATE** is given for an existing file, no error should occur, but the file should ve deleted and then **reCREATEd**. **CREATE** also leaves the file in the same states as an **OPEN** in the output mode. * OPEN mode name >"mode" is either I, O or U indicating the file named "name" is to be opened in the Input, Output, or Update mode. **Input mode** means that only **READ** and **SEEK** commands are permitted. **Output mode** means only **WRITE** commands are permitted. **Update mode** allows **READ**, **WRITE**, and **SEEK** commands. Associated with each open file is a pointer to the next byte to be read or written. Opening a file for input or update places the pointer at the first byte of the file, while opening a file for output places the pointer athe the byte immediately after the last byte of the file. * CLOSE >This command causes the last **OPENed** or **CREATEd** file to be closed. No filename is given. * DELETE name >This command causes the named file to be deleted. * READ n >This command may only be used between an **OPEN** (in input or update mode) and the corresponding **CLOSE**. If possible, "n" bytes of data should be read and displayed. If fewer than "n" bytes remain before the end of file, then those bytes should be read and displayed with a message indicating that the end of file was reached. * WRITE n 'data' >This command causes the first "n" ata bytes from 'data'(actually enclosed in single quotes in the comman line) to be written to the file. If fewer than "n" bytes are given, then append sufficient blanks to 'data' to make "n" bytes. If it is impossible to write "n" bytes(because the disk is full) then an appropriate message should be issued, but the command should be otherwise treated as if the largest possible value o "n" was specified. (That is, the remaining available disk space should be filled.) * SEEK base offset >"base" is either -1, 0, or +1 indicating the beginning of the file, the current position in the file, or the end of file. "offset" is a signed integer indicating the number of bytes from the "base" that the file pointer should be moved. For example, **"SEEK -1 0"** is equivalent to a rewind, **"SEEK +1 0"** is equivalent to a position to end of file, and **"SEEK 0 -5"** positions the file pointer backward by five bytes.

近期下载者

相关文件


收藏者