core/vpl/vpl.h
Go to the documentation of this file.
00001 // This is core/vpl/vpl.h
00002 #ifndef vpl_h_
00003 #define vpl_h_
00004 //:
00005 // \file
00006 // \brief Access to certain POSIX functions.
00007 
00008 #include <vcl_cstddef.h>
00009 
00010 //: Get the pathname of the current working directory.
00011 //
00012 //  If \a buf is not NULL, then \a size must be at least 1 greater
00013 //  than the length of the pathname to be returned and the pathname
00014 //  will be stored in \a buf.  If \a buf is NULL then the pathname
00015 //  will be returned and the returned pointer may be passed to free()
00016 //  by the caller.
00017 //
00018 //  See also: getcwd(3) manpage.
00019 
00020 char           *vpl_getcwd( char *buf, vcl_size_t buf_size );
00021 
00022 //: Create a new directory \a dir with permissions \a mode.
00023 int             vpl_mkdir( const char *dir, unsigned short mode );
00024 
00025 //: Remove the directory \a dir.
00026 int             vpl_rmdir( const char *dir );
00027 
00028 //: Change the working directory to \a dir.
00029 int             vpl_chdir( const char *dir );
00030 
00031 //: Remove the file \a file.
00032 int             vpl_unlink( const char *file );
00033 
00034 //: Sleep for \a t seconds.
00035 unsigned int    vpl_sleep( unsigned int t );
00036 
00037 //: Sleep for \a t microseconds.
00038 int             vpl_usleep( unsigned int t );
00039 
00040 //: Set environment variable
00041 // \param envvar should contain the environment variable name and value
00042 // separated by an equals sign, e.g. "VARNAME=VALUE"
00043 int             vpl_putenv ( const char * envvar );
00044 
00045 //: Get the process identifier.
00046 unsigned        vpl_getpid( ); 
00047 
00048 //: Get the current machine's hostname.
00049 int             vpl_gethostname(char *name, vcl_size_t len ); 
00050 
00051 
00052 #endif // vpl_h_