Main Page Cookbook/Overview ImageMeister the jcprops file Licensing Binary Installation & Configuration [ Win · Mac · Nix · OSX ] Changes Public API Source Code Main Page Java [ Common · Win · Mac · Nix ] Native Code [ Common · Win · Mac · Nix ] Manifest Native Code Overviews [ Common · Win · Mac · Nix · Strings ] Macros [ General · Native Macros ] Walkthroughs [ Java only · Java and native ] Building [ Win · Mac · Nix · OSX ] Distribution Issues

# CNixUtils

  Contains static routines which implement the Linux native code.

[ Linux | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

## Quick Index

  DESCRIPTION

## Class Summary

class CNixUtils
{
public:

  typedef enum tageStatFS eStatFS;
  typedef enum tageStat eStat;
  static long iGetMntEnt( const CStr *csMntFileName, CStringVector *retQuads, long maxToReturn, long *numReturned );
  static long iStatFS( const CStr *csFilePath, long *retArray );
  static long iStat( long selector, CStr *csFilePath, long *retArray, CDateBundle *dateBundle );
  static long iReadLink( const CStr *csLinkName, CStr *csResolvedName );

protected:

}; // CNixUtils

Back to the top of CNixUtils

### DESCRIPTION

These routines wrap the following Linux routines:

- getmntent
- statfs
- stat/lstat
- readlink

Back to the top of CNixUtils

### typedef enum tageStatFS eStatFS;

The array passed to iStatFS must have at least kStatFSRetArrayLen elements, and the return values will be placed at the indicated offsets in the array.

    	typedef enum tageStatFS {
    		kStatFSOffs_type = 0,
    		kStatFSOffs_bsize = 1,
    		kStatFSOffs_blocks = 2,
    		kStatFSOffs_bfree = 3,
    		kStatFSOffs_bavail = 4,
    		kStatFSOffs_files = 5,
    		kStatFSOffs_ffree = 6,
    		kStatFSOffs_fsid0 = 7,
    		kStatFSOffs_fsid1 = 8,
    		kStatFSRetArrayLen = ( kStatFSOffs_fsid1 + 1 )
    	} eStatFS;

Back to the top of CNixUtils

### typedef enum tageStat eStat;

The array passed to iStat must have at least kStatRetArrayLen elements, and the return values will be placed at the indicated offsets in the array.

    	typedef enum tageStat {
    		kStatOffs_dev = 0,
    		kStatOffs_ino = 1,
    		kStatOffs_mode = 2,
    		kStatOffs_nlink = 3,
    		kStatOffs_uid = 4,
    		kStatOffs_gid = 5,
    		kStatOffs_rdev = 6,
    		kStatOffs_size = 7,
    		kStatOffs_blksize = 8,
    		kStatOffs_blocks = 9,
    		kStatRetArrayLen = ( kStatOffs_blocks + 1 )
    	} eStat;

Back to the top of CNixUtils

### long iGetMntEnt( const CStr *csMntFileName, CStringVector *retQuads, long maxToReturn, long *numReturned );

Calls getmntent

in csMntFileName
  full path of the file containing a list of mounted file systems
out retQuads
  on exit, 4 strings about each file system will be stored in this vector, corresponding to the following fields of the 'mntent' struct: mnt_fsname, mnt_dir, mnt_type, and mnt_opts
in maxToReturn
  the maximum number to return
out numReturned
  the number of file systems on which information is returned the number of strings in 'retQuads' will be 4 times this number

    	static	long iGetMntEnt( const CStr *csMntFileName, CStringVector *retQuads, long maxToReturn, long *numReturned );

Back to the top of CNixUtils

### long iStatFS( const CStr *csFilePath, long *retArray );

Calls statfs to return information on the file system containing the given file

in csFilePath
  the full path of the file
out retArray
  on exit, stats on the file system will be placed at offsets defined by eStatFS

    	static	long iStatFS( const CStr *csFilePath, long *retArray );

Back to the top of CNixUtils

### long iStat( long selector, CStr *csFilePath, long *retArray, CDateBundle *dateBundle );

Calls stat to get information on the given file

in selector
  if this is zero, calls stat(); otherwise, calls lstat()
in csFilePath
  the full path of the file
out retArray
  on exit, stats on the file will be placed at offsets defined by eStat
out dateBundle
  the dates of the file will be stored in this object

    	static	long iStat( long selector, CStr *csFilePath, long *retArray, CDateBundle *dateBundle );

Back to the top of CNixUtils

### long iReadLink( const CStr *csLinkName, CStr *csResolvedName );

Calls readlink

in csLinkName
  the full path (which may be a symbolic link) to resolve
out csResolvedName
  on exit, contains the full path of the resolved file

    	static	long iReadLink( const CStr *csLinkName, CStr *csResolvedName );

Back to the top of CNixUtils

## All Members

public:
  typedef enum tageStatFS eStatFS;
  typedef enum tageStat eStat;
  static long iGetMntEnt( const CStr *csMntFileName, CStringVector *retQuads, long maxToReturn, long *numReturned );
  static long iStatFS( const CStr *csFilePath, long *retArray );
  static long iStat( long selector, CStr *csFilePath, long *retArray, CDateBundle *dateBundle );
  static long iReadLink( const CStr *csLinkName, CStr *csResolvedName );
protected:

Back to the top of CNixUtils

## Ancestors

Class does not inherit from any other class.

Back to the top of CNixUtils

## Descendants

Class is not inherited by any others.

Back to the top of CNixUtils

Generated from source by the Cocoon utilities on Fri Aug 23 12:34:47 2002 .

Main Page · JConfig · ImageMeister · System Properties Repository · WordMeister · Free Samples · Java Freeware · Contact Us · FAQ · Links

Copyright (c) 1997-2002 Samizdat Productions. All Rights Reserved.
WarpMovie, TileMovie, JConfig, ImageMeister and MovieShredder are Trademarks of Samizdat Productions.