SimGrid  3.20
Versatile Simulation of Distributed Systems
file_system.h File Reference
#include <simgrid/forward.h>
#include <xbt/base.h>
#include <xbt/dict.h>

Macros

#define MSG_file_open(fullpath, data)   sg_file_open(fullpath, data)
 
#define MSG_file_read(fd, size)   sg_file_read(fd, size)
 
#define MSG_file_write(fd, size)   sg_file_write(fd, size)
 
#define MSG_file_close(fd)   sg_file_close(fd)
 
#define MSG_file_get_name(fd)   sg_file_get_name(fd)
 
#define MSG_file_get_size(fd)   sg_file_get_size(fd)
 
#define MSG_file_dump(fd)   sg_file_dump(fd)
 
#define MSG_file_get_data(fd)   sg_file_get_data(fd)
 
#define MSG_file_set_data(fd, data)   sg_file_set_data(fd, data)
 
#define MSG_file_seek(fd, offset, origin)   sg_file_seek(fd, offset, origin)
 
#define MSG_file_tell(fd)   sg_file_tell(fd)
 
#define MSG_file_move(fd, fullpath)   sg_file_get_size(fd, fullpath)
 
#define MSG_file_unlink(fd)   sg_file_unlink(fd)
 
#define MSG_file_rcopy(file, host, fullpath)   sg_file_rcopy(file, host, fullpath)
 
#define MSG_file_rmove(file, host, fullpath)   sg_file_rmove(file, host, fullpath)
 
#define MSG_storage_file_system_init()   sg_storage_file_system_init()
 
#define MSG_storage_get_free_size(st)   sg_storage_get_size_free(st)
 
#define MSG_storage_get_used_size(st)   sg_storage_get_size_used(st)
 
#define MSG_storage_get_size(st)   sg_storage_get_size(st)
 
#define MSG_storage_get_content(st)   sg_storage_get_content(st)
 
#define MSG_host_get_storage_content(st)   sg_host_get_storage_content(st)
 

Typedefs

typedef sg_file_t msg_file_t
 

Functions

void sg_storage_file_system_init ()
 
sg_file_t sg_file_open (const char *fullpath, void *data)
 
sg_size_t sg_file_read (sg_file_t fd, sg_size_t size)
 
sg_size_t sg_file_write (sg_file_t fd, sg_size_t size)
 
void sg_file_close (sg_file_t fd)
 
const char * sg_file_get_name (sg_file_t fd)
 
sg_size_t sg_file_get_size (sg_file_t fd)
 
void sg_file_dump (sg_file_t fd)
 
voidsg_file_get_data (sg_file_t fd)
 
void sg_file_set_data (sg_file_t fd, void *data)
 
void sg_file_seek (sg_file_t fd, sg_offset_t offset, int origin)
 Set the file position indicator in the sg_file_t by adding offset bytes to the position specified by origin (either SEEK_SET, SEEK_CUR, or SEEK_END). More...
 
sg_size_t sg_file_tell (sg_file_t fd)
 
void sg_file_move (sg_file_t fd, const char *fullpath)
 
void sg_file_unlink (sg_file_t fd)
 
int sg_file_rcopy (sg_file_t file, sg_host_t host, const char *fullpath)
 Copy a file to another location on a remote host. More...
 
int sg_file_rmove (sg_file_t file, sg_host_t host, const char *fullpath)
 Move a file to another location on a remote host. More...
 
sg_size_t sg_storage_get_size_free (sg_storage_t st)
 
sg_size_t sg_storage_get_size_used (sg_storage_t st)
 
sg_size_t sg_storage_get_size (sg_storage_t st)
 
xbt_dict_t sg_storage_get_content (sg_storage_t storage)
 
xbt_dict_t sg_host_get_storage_content (sg_host_t host)
 

Macro Definition Documentation

◆ MSG_file_open

#define MSG_file_open (   fullpath,
  data 
)    sg_file_open(fullpath, data)

◆ MSG_file_read

#define MSG_file_read (   fd,
  size 
)    sg_file_read(fd, size)

◆ MSG_file_write

#define MSG_file_write (   fd,
  size 
)    sg_file_write(fd, size)

◆ MSG_file_close

#define MSG_file_close (   fd)    sg_file_close(fd)

◆ MSG_file_get_name

#define MSG_file_get_name (   fd)    sg_file_get_name(fd)

◆ MSG_file_get_size

#define MSG_file_get_size (   fd)    sg_file_get_size(fd)

◆ MSG_file_dump

#define MSG_file_dump (   fd)    sg_file_dump(fd)

◆ MSG_file_get_data

#define MSG_file_get_data (   fd)    sg_file_get_data(fd)

◆ MSG_file_set_data

#define MSG_file_set_data (   fd,
  data 
)    sg_file_set_data(fd, data)

◆ MSG_file_seek

#define MSG_file_seek (   fd,
  offset,
  origin 
)    sg_file_seek(fd, offset, origin)

◆ MSG_file_tell

#define MSG_file_tell (   fd)    sg_file_tell(fd)

◆ MSG_file_move

#define MSG_file_move (   fd,
  fullpath 
)    sg_file_get_size(fd, fullpath)

◆ MSG_file_unlink

#define MSG_file_unlink (   fd)    sg_file_unlink(fd)

◆ MSG_file_rcopy

#define MSG_file_rcopy (   file,
  host,
  fullpath 
)    sg_file_rcopy(file, host, fullpath)

◆ MSG_file_rmove

#define MSG_file_rmove (   file,
  host,
  fullpath 
)    sg_file_rmove(file, host, fullpath)

◆ MSG_storage_file_system_init

#define MSG_storage_file_system_init ( )    sg_storage_file_system_init()

◆ MSG_storage_get_free_size

#define MSG_storage_get_free_size (   st)    sg_storage_get_size_free(st)

◆ MSG_storage_get_used_size

#define MSG_storage_get_used_size (   st)    sg_storage_get_size_used(st)

◆ MSG_storage_get_size

#define MSG_storage_get_size (   st)    sg_storage_get_size(st)

◆ MSG_storage_get_content

#define MSG_storage_get_content (   st)    sg_storage_get_content(st)

◆ MSG_host_get_storage_content

#define MSG_host_get_storage_content (   st)    sg_host_get_storage_content(st)

Typedef Documentation

◆ msg_file_t

Function Documentation

◆ sg_storage_file_system_init()

◆ sg_file_open()

sg_file_t sg_file_open ( const char *  fullpath,
void data 
)

◆ sg_file_read()

sg_size_t sg_file_read ( sg_file_t  fd,
sg_size_t  size 
)

◆ sg_file_write()

sg_size_t sg_file_write ( sg_file_t  fd,
sg_size_t  size 
)

◆ sg_file_close()

void sg_file_close ( sg_file_t  fd)

◆ sg_file_get_name()

const char* sg_file_get_name ( sg_file_t  fd)

◆ sg_file_get_size()

sg_size_t sg_file_get_size ( sg_file_t  fd)

◆ sg_file_dump()

void sg_file_dump ( sg_file_t  fd)

◆ sg_file_get_data()

void* sg_file_get_data ( sg_file_t  fd)

◆ sg_file_set_data()

void sg_file_set_data ( sg_file_t  fd,
void data 
)

◆ sg_file_seek()

void sg_file_seek ( sg_file_t  fd,
sg_offset_t  offset,
int  origin 
)

Set the file position indicator in the sg_file_t by adding offset bytes to the position specified by origin (either SEEK_SET, SEEK_CUR, or SEEK_END).

Parameters
fd: file object that identifies the stream
offset: number of bytes to offset from origin
origin: Position used as reference for the offset. It is specified by one of the following constants defined in <stdio.h> exclusively to be used as arguments for this function (SEEK_SET = beginning of file, SEEK_CUR = current position of the file pointer, SEEK_END = end of file)

◆ sg_file_tell()

sg_size_t sg_file_tell ( sg_file_t  fd)

◆ sg_file_move()

void sg_file_move ( sg_file_t  fd,
const char *  fullpath 
)

◆ sg_file_unlink()

void sg_file_unlink ( sg_file_t  fd)

◆ sg_file_rcopy()

int sg_file_rcopy ( sg_file_t  file,
sg_host_t  host,
const char *  fullpath 
)

Copy a file to another location on a remote host.

Parameters
file: the file to move
host: the remote host where the file has to be copied
fullpath: the complete path destination on the remote host
Returns
If successful, the function returns 0. Otherwise, it returns -1.

◆ sg_file_rmove()

int sg_file_rmove ( sg_file_t  file,
sg_host_t  host,
const char *  fullpath 
)

Move a file to another location on a remote host.

Parameters
file: the file to move
host: the remote host where the file has to be moved
fullpath: the complete path destination on the remote host
Returns
If successful, the function returns 0. Otherwise, it returns -1.

◆ sg_storage_get_size_free()

◆ sg_storage_get_size_used()

◆ sg_storage_get_size()

◆ sg_storage_get_content()

xbt_dict_t sg_storage_get_content ( sg_storage_t  storage)

◆ sg_host_get_storage_content()

xbt_dict_t sg_host_get_storage_content ( sg_host_t  host)