class org.simgrid.msg.File

public class File

Fields

SEEK_CUR

public static final int SEEK_CUR

SEEK_END

public static final int SEEK_END

SEEK_SET

public static final int SEEK_SET

Constructors

File

public File(String path)

Constructor, opens the file.

Parameters:
  • path – is the file location on the storage

Methods

close

public native void close()

Close the file.

nativeInit

public static native void nativeInit()

Class initializer, to initialize various JNI stuff

open

protected native void open(String path)

Opens the file whose name is the string pointed to by path.

Parameters:
  • path – is the file location on the storage

read

public native long read(long size, long nMemb)

Read elements of a file.

Parameters:
  • size – of each element
  • nMemb – is the number of elements of data to write
Returns:

the actually read size

seek

public native void seek(long offset, long origin)

Write elements into a file.

Parameters:
  • 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)

write

public native long write(long size, long nMemb)

Write elements into a file.

Parameters:
  • size – of each element
  • nMemb – is the number of elements of data to write
Returns:

the actually written size