public abstract class BaseFileSystem<T extends NewFileIO> extends Object implements FileSystem<T>
| Modifier and Type | Field and Description |
|---|---|
protected Emulator<T> |
emulator |
protected File |
rootDir |
DEFAULT_ROOT_FS, DEFAULT_WORK_DIR| Constructor and Description |
|---|
BaseFileSystem(Emulator<T> emulator,
File rootDir) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
createStdin(int oflags) |
protected abstract T |
createStdout(int oflags,
File stdio,
String pathname) |
File |
createWorkDir() |
File |
getRootDir() |
protected abstract boolean |
hasAppend(int oflags) |
protected abstract boolean |
hasCreat(int oflags) |
protected abstract boolean |
hasDirectory(int oflags) |
protected abstract boolean |
hasExcl(int oflags) |
protected void |
initialize(File rootDir) |
boolean |
mkdir(String path,
int mode) |
FileResult<T> |
open(String pathname,
int oflags) |
int |
rename(String oldPath,
String newPath) |
void |
rmdir(String path) |
void |
unlink(String path) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDirectoryFileIO, createSimpleFileIOprotected final File rootDir
protected void initialize(File rootDir) throws IOException
IOExceptionpublic FileResult<T> open(String pathname, int oflags)
open in interface FileSystem<T extends NewFileIO>protected abstract T createStdin(int oflags)
public boolean mkdir(String path, int mode)
mkdir in interface FileSystem<T extends NewFileIO>true表示创建成功public void rmdir(String path)
rmdir in interface FileSystem<T extends NewFileIO>protected abstract boolean hasCreat(int oflags)
protected abstract boolean hasDirectory(int oflags)
protected abstract boolean hasAppend(int oflags)
protected abstract boolean hasExcl(int oflags)
public void unlink(String path)
unlink in interface FileSystem<T extends NewFileIO>public File getRootDir()
getRootDir in interface FileSystem<T extends NewFileIO>public File createWorkDir()
createWorkDir in interface FileSystem<T extends NewFileIO>Copyright © 2026. All rights reserved.