IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


Input/Output Functions


Detailed Description

This sections describes the various functions supporting the access to input/output devices such as standard input/output or files.

Data Structures

struct  ftime
 File date info. More...

Defines

#define ESHARE   1000
 Sharing violation.
#define ENODRV   1001
 Invalid drive specified.
#define ENOUSER   1002
 Too many tasks registered with file system.
#define EROOTFULL   1003
 FAT12/FAT16 root directory full.
#define ENOTSAM   1004
 Not same device.
#define S_IFMT   0xF000
 File status/attribute Filetype mask.
#define S_IFDIR   0x4000
 File status/attribute flag Directory.
#define S_IFIFO   0x1000
 File status/attribute flag Fifo.
#define S_IFCHR   0x2000
 File status/attribute flag Character.
#define S_IFBLK   0x3000
 File status/attribute flag Blocking.
#define S_IFREG   0x8000
 File status/attribute flag Regular.
#define S_IREAD   0x0100
 File status/attribute flag Read.
#define S_IWRITE   0x0080
 File status/attribute flag Write.
#define S_IEXEC   0x0040
 File status/attribute flag Execute.
#define O_BINARY   0x8000
 Open in binary mode.
#define O_TEXT   0x4000
 Open in text mode.
#define O_RDONLY   0x0000
 Open for reading only.
#define O_WRONLY   0x0001
 Open for writing only.
#define O_RDWR   0x0002
 Open for reading and writing.
#define O_APPEND   0x0008
 Open for appending.
#define O_CREAT   0x0200
 Open, create if does not exist.
#define O_TRUNC   0x0400
 Open, truncate if exist.
#define O_EXCL   0x0800
 Open if exist only.
#define O_NOSHAREANY   0x0004
 Does not allow file sharing.
#define O_NOSHAREWR   0x0800
 Does not allow write-file sharing.
#define WILDCARDS   0x01
 Identifies a wildcard within a fnsplit result.
#define EXTENSION   0x02
 Identifies a extension within a fnsplit result.
#define FILENAME   0x04
 Identifies the directory within a fnsplit result.
#define DIRECTORY   0x08
 Identifies the directory within a fnsplit result.
#define DRIVE   0x10
 Identifies the drive within a fnsplit result.
#define MAXDRIVE   3
 Maximum drive length.
#define MAXPATH   80
 Maximum path length.
#define MAXDIR   66
 Maximum dir length.
#define MAXFILE   9
 Maximum filename length.
#define MAXEXT   5
 Maximum extension length.
#define _A_NORMAL   0x00
 File attribute used by _dos_getfileattr() and _dos_setfileattr().
#define _A_RDONLY   0x01
 File attribute used by _dos_getfileattr() and _dos_setfileattr().
#define _A_HIDDEN   0x02
 File attribute used by _dos_getfileattr() and _dos_setfileattr().
#define _A_SYSTEM   0x04
 File attribute used by _dos_getfileattr() and _dos_setfileattr().
#define _A_VOLID   0x08
 File attribute used by _dos_getfileattr() and _dos_setfileattr().
#define _A_SUBDIR   0x10
 File attribute used by _dos_getfileattr() and _dos_setfileattr().
#define _A_ARCH   0x20
 File attribute used by _dos_getfileattr() and _dos_setfileattr().
#define _fileno(f)   ((int)((f)->_file))
 Convert file pointer to file number.

Functions

static int getch (void)
 Gets character from standard input.
static int getche (void)
 Gets character from standard input with echo.
static int kbhit (void)
 Checks for data on standard input.
int chdir (const char *path)
 Changes current directory.
int setdisk (int drive)
 Sets the current drive number.
char * getcwd (char *buf, int buflen)
 Gets current working directory.
int getdisk (void)
 Gets the current drive number.
int getcurdir (int drive, char *directory)
 Gets current directory for specified drive.
void fnmerge (char *path, const char *drive, const char *dir, const char *name, const char *ext)
 Builds a path from component parts.
int fnsplit (const char *path, char *drive, char *dir, char *name, char *ext)
 Splits a full path name into its components.
int mkdir (const char *path)
 Creates a directory.
int _rmdir (const char *path)
 Removes a directory.
int rmdir (const char *path)
 Removes a directory.
int _dos_getfileattr (const char *filename, unsigned *attribp)
 Get specified file's attributes.
int _dos_setfileattr (const char *filename, unsigned attrib)
 Set specified file's attributes.
int _chmod (const char *filename, int func,...)
 Get or set specified file's attributes.
int chsize (int handle, long newsize)
 Changes the file's size.
long filelength (int handle)
 Gets file size in bytes.
int getftime (int handle, struct ftime *ftimep)
 Gets file time.
int setftime (int handle, const struct ftime *ftimep)
 Sets file time.
int open (const char *name, int flags, unsigned mode)
 Open a file.
_ssize_t read (int file, void *ptr, size_t len)
 Read from a file or device.
_ssize_t write (int file, const void *ptr, size_t len)
 Write to a file or device.
long lseek (int handle, long offset, int where)
 Moves the file pointer.
int close (int file)
 Close a file.
int unlink (const char *filename)
 Deletes a file.
int tell (int handle)
 Get the pointer of a given file.
int rename (const char *old, const char *new)
 Rename or move a file or directory.

Variables

int _fmode
 Determines in which mode files will be opened by default.





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:35 2017 by Doxygen 1.6.1