Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

PHAT Utilities
[PHAT File System]

Collaboration diagram for PHAT Utilities:


Detailed Description

General utility routines used by the PHAT file system.


Functions

void GetDosTimeStamp (u_short *dostim, u_short *dosdat)
 Create a DOS timestamp of the current time and date.
int MakePhatName (CONST char *src, u_char *dst)
 Convert filename to a directory entry name.
void MakeVisibleName (CONST u_char *src, char *dst)
 Convert a directory entry name to a visible file name.
char * GetParentPath (CONST char *path, CONST char **comp)
 Chop off the last component of a path.
int IsFixedRootDir (NUTFILE *ndp)
 Test for PHAT12/PHAT16 root directory.
void PhatFilePosRewind (PHATFILE *fcb)
 Set file pointer back to zero.
int PhatFilePosSet (NUTFILE *nfp, u_long pos)
 Move file pointer to a specified position.


Function Documentation

void GetDosTimeStamp u_short dostim,
u_short dosdat
 

Create a DOS timestamp of the current time and date.

Parameters:
dostim Receives the time of day part.
dosdat Receives the calendar date part.

int MakePhatName CONST char *  src,
u_char dst
 

Convert filename to a directory entry name.

Parameters:
src Original name in the format 'name.ext'.
dst Converted name in the format 'name ext'.
Returns:
0 on success, 1 if the name contains wildcards or -1 if the name is malformed.

void MakeVisibleName CONST u_char src,
char *  dst
 

Convert a directory entry name to a visible file name.

Parameters:
src Original name in the format 'name ext'.
dst Converted name in the format 'name.ext'.
Returns:
0 on success, 1 if the name contains wildcards or -1 if the name is malformed.

char* GetParentPath CONST char *  path,
CONST char **  comp
 

Chop off the last component of a path.

Parameters:
path Full path.
comp Points to a pointer which will be set to the last component within the full path.
Returns:
Pointer to a newly allocated string containing the parent path, or NULL in case of an error. The allocated buffer must be released by the caller.

int IsFixedRootDir NUTFILE ndp  ) 
 

Test for PHAT12/PHAT16 root directory.

Parameters:
ndp Handle of an opened file to check.
Returns:
0 if the file is not a fixed root directory.

void PhatFilePosRewind PHATFILE fcb  ) 
 

Set file pointer back to zero.

Parameters:
fcb Specifies the file control block.

int PhatFilePosSet NUTFILE nfp,
u_long  pos
 

Move file pointer to a specified position.

Moving beyond the current file size is not supported.

Parameters:
nfp File descriptor.
pos Requested file position.
Returns:
0 on success, -1 otherwise. In the latter case the position is unspecified.


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/