Main Page | Modules | Data Structures | File List | Data Fields | Globals

Virtual File System.

This module do an abstraction of local systelm filesystem to ensure platforms compatibilty. More...


Files

file  vfile.c
 VFile core file.

Functions

l_long file_get_mlong (PFile f)
 Reads a long in motorola format from a file stream.
void FreeFileInfo (PFileInfo o)
 Free a File Information.
PList ListDir (l_text Dir, l_uchar Attrib)
 List a directory.
PList ListDir2 (PFileInfo fi, l_uchar Attrib)
 List a directory.
PFile FileOpen (l_text File, l_text Mode)
 Open a file stream.
PFile FileOpen2 (PFileInfo fi, l_text Mode)
 Open a file stream from of FileInfo reference.
void FileClose (PFile f)
 Close a file stream.
l_int FileEOF (PFile f)
 Determines if pointer is at the end of the file.
l_int FileRead (void *o, l_ulong n, l_ulong s, PFile f)
 Read data from a file stream and store it to memory.
l_int FileWrite (void *o, l_ulong n, l_ulong s, PFile f)
 Write data to a file stream from memory.
l_text FileGets (l_text s, l_int n, PFile f)
 Read a line form a file buffer.
l_bool FileWriteBinString (PFile f, l_text Txt)
 Write a string to a file stream in binary mode.
l_text FileReadBinString (PFile f)
 Read a string from a file stream in binary mode written by FileWriteBinString.
PFileInfo FileGetInfo (l_text File)
 Get a File Information from a file.
l_bool FileSetAttributes (l_text File, l_uchar Attrib)
 Change a file attributes.
l_text GetPathParent (l_text dir)
 Determines the parent of a path.
l_bool MakeDir (l_text Path)
 Creates a directory.
l_text ResolveFileName (l_text File)
 Clean a path.
int GSSystemVFSInstall (void)
 NAME: GSSystemVFSInstall DESCRIPTION: Installs the VFS, is called during kernel setup.

Detailed Description

This module do an abstraction of local systelm filesystem to ensure platforms compatibilty.

Most standart functions are provided but under an unuasual name. (fread becomes FileRead)


Function Documentation

l_long file_get_mlong PFile  f  ) 
 

Reads a long in motorola format from a file stream.

Parameters:
f File stream
Returns:
the value or EOF if end of file is reached

void FileClose PFile  f  ) 
 

Close a file stream.

Parameters:
f File stream

l_int FileEOF PFile  f  ) 
 

Determines if pointer is at the end of the file.

Parameters:
f File stream
Returns:
true if pointer is at the end of the file, else false

PFileInfo FileGetInfo l_text  File  ) 
 

Get a File Information from a file.

Parameters:
File Name of the file
Returns:
NULL if file is not found, else return the File Info

l_text FileGets l_text  s,
l_int  n,
PFile  f
 

Read a line form a file buffer.

Stops if buffer is full or when a end of line or end of file is reached.

Parameters:
s Pointer to the place to store data (buffer)
n Size of the reserved place (size of buffer)
f File stream
Returns:
s when a line is read, return NULL when end of file is reached and that no bytes have been stored.

PFile FileOpen l_text  File,
l_text  Mode
 

Open a file stream.

Parameters:
File Name of the file to open
Mode Filestream mode
Returns:
NULL if file not found (read), or enable to create file (write) or the filestream

PFile FileOpen2 PFileInfo  fi,
l_text  Mode
 

Open a file stream from of FileInfo reference.

Parameters:
fi FileInfo reference
Mode Filestream mode
Returns:
NULL if file not found (read), or enable to create file (write) or the filestream

l_int FileRead void *  o,
l_ulong  n,
l_ulong  s,
PFile  f
 

Read data from a file stream and store it to memory.

Reads n*s bytes.

Parameters:
o Pointer to the memory to store data
s Size of a block
n Number of blocks to read
f File stream
Returns:
Number of bytes read, of EOF if end of file is reached

l_text FileReadBinString PFile  f  ) 
 

Read a string from a file stream in binary mode written by FileWriteBinString.

Parameters:
f File stream
Returns:
A pointer to the text (new allocation), or NULL on error
Note:
Don't forget to free the returned data
See also:
FileWriteBinString

l_bool FileSetAttributes l_text  File,
l_uchar  Attrib
 

Change a file attributes.

Parameters:
File Name of the file
Attrib Attributes to set to the file
Returns:
true on success, else false

l_int FileWrite void *  o,
l_ulong  n,
l_ulong  s,
PFile  f
 

Write data to a file stream from memory.

Write n*s bytes.

Parameters:
o Pointer to the data to write
s Size of a block
n Number of blocks to write
f File stream
Returns:
Number of bytes written

l_bool FileWriteBinString PFile  f,
l_text  Txt
 

Write a string to a file stream in binary mode.

The string can be read by FileReadBinString.

Parameters:
f File stream
Txt Pointer to the text to write
Returns:
true on sucess, or false on error
See also:
FileReadBinString

void FreeFileInfo PFileInfo  o  ) 
 

Free a File Information.

Parameters:
o FileInfo to free
See also:
FileGetInfo

l_text GetPathParent l_text  dir  ) 
 

Determines the parent of a path.

Path should be an absolute one (exemple : "/c/my files/stuff")

Parameters:
dir Path
Returns:
the path to the parent (new allocation), or NULL on error
Note:
Don't forget to free the returned text.

PList ListDir l_text  Dir,
l_uchar  Attrib
 

List a directory.

Parameters:
Dir Name of directory to list
Attrib Filter by attributes
Returns:
Return listing as a PList of PFileInfo

PList ListDir2 PFileInfo  fi,
l_uchar  Attrib
 

List a directory.

Parameters:
fi PFileInfo of the directory
Attrib Filter by attributes
Returns:
Return listing as a PList of PFileInfo

l_bool MakeDir l_text  Path  ) 
 

Creates a directory.

Parameters:
Path Path of the directory to create
Returns:
true on success or false on error

l_text ResolveFileName l_text  File  ) 
 

Clean a path.

Removes and solve the "/./", "/../", "//"

Parameters:
File Path to clean
Returns:
the cleaned path (new allocation)
Note:
don't forget to free the returned text


Generated on Fri Oct 29 14:32:53 2004 for oZone GUI by doxygen 1.3.8