diet-fms-lib.h File Reference

#include <sys/types.h>
#include <limits.h>
#include <pthread.h>

Go to the source code of this file.

Classes

struct  diet_stat_t
 A specific data structure for file information representation through DIET. More...

Enumerations

enum  diet_file_type_t {
  DFMS_BLOCK, DFMS_CHARACTER, DFMS_DIRECTORY, DFMS_SYMLINK,
  DFMS_SOCKET, DFMS_FIFO, DFMS_REGULAR
}
 

An enum for the file type specifications.

More...

Functions

int dietchgrp (const char *path, const char *group)
int dietchmod (const char *path, const mode_t mode)
int dietcp (const char *src, const char *dest)
int dietcp_async (const char *src, const char *dest, unsigned long long *thrRef)
int diethead (const char *path, const unsigned int nline, char *buffer, const size_t maxsize)
int dietls (const char *path, char *buffer, const size_t maxsize)
int dietmkdir (const char *path, const mode_t mode)
int dietmv (const char *src, const char *dest)
int dietmv_async (const char *src, const char *dest, unsigned long long *thrRef)
int dietrm (const char *path)
int dietrmdir (const char *path)
int diettail (const char *path, const unsigned int nline, char *buffer, const size_t maxsize)
int dietstat (const char *path, struct diet_stat_t *buf)
int dietwait (const unsigned long long thrID)

Enumeration Type Documentation

An enum for the file type specifications.

Enumerator:
DFMS_BLOCK 
DFMS_CHARACTER 

Enum value for block special files.

DFMS_DIRECTORY 

Enum value for character files.

DFMS_SYMLINK 

Enum value for directories.

DFMS_SOCKET 

Enum value for symbolic links.

DFMS_FIFO 

Enum value for sockets.

DFMS_REGULAR 

Enum value for FIFO files.

Enum value for regular files.


Function Documentation

int dietchgrp ( const char *  path,
const char *  group 
)

dietchgrp - change the group of a file

Parameters:
path the file path using host:path format
group the name of the new group to use for this file
Returns:
0 if everything is OK, another value otherwise
int dietchmod ( const char *  path,
const mode_t  mode 
)

dietchmod - change the permissions of a file

Parameters:
path,: the file path using host:path format
mode,: the permission mode to use for this file
Returns:
0 if everything is OK, another value otherwise
int dietcp ( const char *  src,
const char *  dest 
)

dietcp - copy the file

Parameters:
src,: the "source" file path using host:path format
dest,: the "destination" file path using host:path format
Returns:
0 if everything is OK, another value otherwise
int dietcp_async ( const char *  src,
const char *  dest,
unsigned long long *  thrRef 
)

dietcp_async - copy the file in a asynchronous mode

Parameters:
src,: the "source" file path using host:path format
dest,: the "destination" file path using host:path format
thrRef,: the thread ID that can be used by dietwait
See also:
dietwait
Returns:
0 if everything is OK, another value otherwise
int diethead ( const char *  path,
const unsigned int  nline,
char *  buffer,
const size_t  maxsize 
)

diethead - get the first lines of a file

Parameters:
path,: the file path using host:path format
nline,: the maximum number of lines to get
buffer,: an user-allocated buffer to store the result
maxsize,: the maximum size to use to prevent buffer overflows
Returns:
0 if everything is OK, another value otherwise
int dietls ( const char *  path,
char *  buffer,
const size_t  maxsize 
)

dietls - get the list of files and subdirectories of a directory

Parameters:
path,: the directory path using host:path format
buffer,: an user-allocated buffer to store the result
maxsize,: the maximum size to use to prevent buffer overflows
Returns:
0 if everything is OK, another value otherwise
int dietmkdir ( const char *  path,
const mode_t  mode 
)

dietmkdir - create a directory

Parameters:
path,: the directory path using host:path format
mode,: the permission mode to use for the new directory
Returns:
0 if everything is OK, another value otherwise
int dietmv ( const char *  src,
const char *  dest 
)

dietmv - move a file

Parameters:
src,: the "source" file path using host:path format
dest,: the "destination" file path using host:path format
Returns:
0 if everything is OK, another value otherwise
int dietmv_async ( const char *  src,
const char *  dest,
unsigned long long *  thrRef 
)

dietmv_async - move a file in a asynchronous mode

Parameters:
src,: the "source" file path using host:path format
dest,: the "destination" file path using host:path format
thrRef,: the thread ID that can be use by dietwait
See also:
dietwait
Returns:
0 if everything is OK, another value otherwise
int dietrm ( const char *  path  ) 

dietrm - remove a file

Parameters:
path,: the file path using host:path format
Returns:
0 if everything is OK, another value otherwise
int dietrmdir ( const char *  path  ) 

dietrmdir - remove an empty directory

Parameters:
path,: the directory path using host:path format
Returns:
0 if everything is OK, another value otherwise
int dietstat ( const char *  path,
struct diet_stat_t buf 
)

dietstat - obtain informations about a file

Parameters:
path,: the file path using host:path format
buf,: a buffer to store the informations
Returns:
0 if everything is OK, another value otherwise
int diettail ( const char *  path,
const unsigned int  nline,
char *  buffer,
const size_t  maxsize 
)

diettail - get the last lines of a file

Parameters:
path,: the file path using host:path format
nline,: the maximum number of lines to get
buffer,: an user-allocated buffer to store the result
maxsize,: the maximum size to use to prevent buffer overflows
Returns:
0 if everything is OK, another value otherwise
int dietwait ( const unsigned long long  thrID  ) 

dietwait - wait for the end of a transfer

Parameters:
thrID,: the transfer id obtained after a call to dietcp_async or dietmv_async.
Returns:
0 if everything is OK, another value otherwise
 All Classes Files Functions Variables Enumerations Enumerator

Generated by  doxygen 1.6.2