Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

File and Directory Management
[FILE - Class for file management]


Functions

bool otFILE.stat (const char *path, FINF fno)
bool otFILE.unlink (const char *path)
bool otFILE.rename (const char *old_name, const char *new_name)
bool otFILE.chmod (const char *path, U8 attr, U8 mask)
bool otFILE.utime (const char *path, FINF fno)
bool otFILE.mkdir (const char *path)
bool otFILE.chdir (const char *path)
bool otFILE.chdrive (const char *path)
bool otFILE.getcwd (void *buffer, U32 len)
bool otFILE.copy (const char *src_name, const char *dst_name)
bool otFILE.move (const char *src_name, const char *dst_name)
bool otFILE.ls (const char *path, int displayLine=20)
bool otFILE.type (const char *src_name, int displayLine=20)

Function Documentation

bool otFILE.chdir (  const char *  path  )  [inherited]
 

Function changes the current directory of the logical drive.

Parameters:
path Pointer to the null-terminated string that specifies the directory to be set as current directory.
Returns:
True on success

bool otFILE.chdrive (  const char *  path  )  [inherited]
 

Function changes the current drive.

Parameters:
path Specifies the logical drive number to be set as the current drive.
Returns:
True on success

bool otFILE.chmod (  const char *  path,
U8  attr,
U8  mask
)  [inherited]
 

Function changes the attribute of a file or sub-directory.

Parameters:
path Pointer to the null-terminated string that specifies an object to be changed.
attr Attribute flags to be set in one or more combination of the following flags. The specified flags are set and others are cleard. See FileInfo
mask Attribute mask that specifies which attribute is changed. The specified attributes are set or cleard and others are left unchanged.
Returns:
True on success

bool otFILE.copy (  const char *  src_name,
const char *  dst_name
)  [inherited]
 

Copy a file on a specified file path name.

Parameters:
src_name Source file path to be read
dst_name Destination file path to be written
Returns:
True on success

bool otFILE.getcwd (  void *  buffer,
U32  len
)  [inherited]
 

Function retrieves the current directory of the current drive.

Parameters:
buffer Pointer to the buffer to receive the current directory string.
len Size of the buffer in unit of U8.
Returns:
True on success

bool otFILE.ls (  const char *  path,
int  displayLine = 20
)  [inherited]
 

List directory contents

Parameters:
path File path to display its contents.
displayLine Maximum number of lines displayed before a break occurs. See setStdin.
Returns:
True on success

bool otFILE.mkdir (  const char *  path  )  [inherited]
 

Function creates a new directory.

Parameters:
path Pointer to the null-terminated string that specifies the directory name to create.
Returns:
True on success

bool otFILE.move (  const char *  src_name,
const char *  dst_name
)  [inherited]
 

Move a file to a specified file path name.

Parameters:
src_name Source file path to be read
dst_name Destination file path to be written
Returns:
True on success

bool otFILE.rename (  const char *  old_name,
const char *  new_name
)  [inherited]
 

Function renames and/or moves a file or sub-directory.

Parameters:
old_name Pointer to a null-terminated string that specifies the existing file or sub-directory to be renamed.
new_name Pointer to a null-terminated string that specifies the new object name.
Returns:
True on success

bool otFILE.stat (  const char *  path,
FINF  fno
)  [inherited]
 

Function checks the existence of a file or sub-directory.

Parameters:
path Pointer to the null-terminated string that specifies the object to get its information. The object must not be the root directory.
fno Pointer to the blank FILINFO structure to store the information of the object. Set null pointer if it is not needed.
Returns:
True if the file or directory exist.

bool otFILE.type (  const char *  src_name,
int  displayLine = 20
)  [inherited]
 

Display the contents of a text file.

Parameters:
src_name File path name of the file to be displayed.
displayLine Maximum number of lines displayed before a break occurs. See setStdin.
Returns:
True on success

bool otFILE.unlink (  const char *  path  )  [inherited]
 

Function removes a file or sub-directory from the volume.

Parameters:
path Pointer to a null-terminated string that specifies the file or sub-directory to be removed.
Returns:
True on deleted

bool otFILE.utime (  const char *  path,
FINF  fno
)  [inherited]
 

Function changes the timestamp of a file or sub-directory.

Parameters:
path Pointer to the null-terminated string that specifies an object to be changed.
fno Pointer to the file information structure that has a timestamp to be set in member fdate and ftime. Do not care any other members.
Returns:
True on success
footer

otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0