WISP ERT (Server)  1.0.0
The WISP Extended Runtime (Server side)
wisp_ert.fs.LocalFS Class Reference

Local file system service class. More...

Inheritance diagram for wisp_ert.fs.LocalFS:
wisp_ert.runtime.Service

Public Member Functions

def __init__ (self, root_dir="/")
 Local file system service constructor. More...
 
def open (self, path, flags, mode=0o666)
 Open a file with given flags and mode. More...
 
def close (self, fd)
 Close a file. More...
 
def read (self, fd, size)
 Read given size of data from file. More...
 
def functions (self)
 Get ERT service functions. More...
 
- Public Member Functions inherited from wisp_ert.runtime.Service
def constants (self)
 Get C constants provided by this service. More...
 
def functions (self)
 Get C functions provided by this service. More...
 

Static Public Attributes

 write = urpc_sig([I16, VARY], [I16], _proxy_sys("write"))
 Write system call proxy. More...
 
 lseek = urpc_sig([I16, I16, I16], [I16], _proxy_sys("lseek"))
 Lseek system call proxy. More...
 
list constants
 ERT constants. More...
 

Private Attributes

 _root_dir
 Local file system root. More...
 
 _fd_mapping
 File descriptor mapping. More...
 

Static Private Attributes

 _close = _proxy_sys("close")
 Close system call proxy. More...
 
 _read = _proxy_sys("read")
 Read system call proxy. More...
 

Detailed Description

Local file system service class.

Constructor & Destructor Documentation

◆ __init__()

def wisp_ert.fs.LocalFS.__init__ (   self,
  root_dir = "/" 
)

Local file system service constructor.

Parameters
root_dirLocal file system root.

Member Function Documentation

◆ close()

def wisp_ert.fs.LocalFS.close (   self,
  fd 
)

Close a file.

Parameters
fdLocalFS virtual file descriptor.
Returns
0 on success, or negative error number on failure.

◆ functions()

def wisp_ert.fs.LocalFS.functions (   self)

Get ERT service functions.

◆ open()

def wisp_ert.fs.LocalFS.open (   self,
  path,
  flags,
  mode = 0o666 
)

Open a file with given flags and mode.

Parameters
pathPath of the file.
flagsOpen flags.
modeFile mode when a new file is going to be created.
Returns
File descriptor on success, or negative error number on failure.

◆ read()

def wisp_ert.fs.LocalFS.read (   self,
  fd,
  size 
)

Read given size of data from file.

Parameters
fdLocalFS virtual file descriptor.
sizeSize of data to read.
Returns
: Data and its size on success, or negative error number on failure.

Member Data Documentation

◆ _close

wisp_ert.fs.LocalFS._close = _proxy_sys("close")
staticprivate

Close system call proxy.

◆ _fd_mapping

wisp_ert.fs.LocalFS._fd_mapping
private

File descriptor mapping.

◆ _read

wisp_ert.fs.LocalFS._read = _proxy_sys("read")
staticprivate

Read system call proxy.

◆ _root_dir

wisp_ert.fs.LocalFS._root_dir
private

Local file system root.

◆ constants

list wisp_ert.fs.LocalFS.constants
static
Initial value:
= [
# Open flags
(os.O_CREAT, I16),
(os.O_RDONLY, I16),
(os.O_WRONLY, I16),
(os.O_RDWR, I16),
(os.O_CREAT, I16),
# Whence
(os.SEEK_SET, I16),
(os.SEEK_CUR, I16),
(os.SEEK_END, I16),
# Error numbers
(errno.EBADF, I16),
(errno.EINVAL, I16),
]

ERT constants.

◆ lseek

wisp_ert.fs.LocalFS.lseek = urpc_sig([I16, I16, I16], [I16], _proxy_sys("lseek"))
static

Lseek system call proxy.

◆ write

wisp_ert.fs.LocalFS.write = urpc_sig([I16, VARY], [I16], _proxy_sys("write"))
static

Write system call proxy.


The documentation for this class was generated from the following file: