1 class org.simgrid.msg.File
2 ==========================
4 .. java:package:: org.simgrid.msg
7 .. java:type:: public class File
14 .. java:field:: public static final int SEEK_CUR
20 .. java:field:: public static final int SEEK_END
26 .. java:field:: public static final int SEEK_SET
34 .. java:constructor:: public File(String path)
37 Constructor, opens the file.
39 :param path: is the file location on the storage
46 .. java:method:: public native void close()
54 .. java:method:: public static native void nativeInit()
57 Class initializer, to initialize various JNI stuff
62 .. java:method:: protected native void open(String path)
65 Opens the file whose name is the string pointed to by path.
67 :param path: is the file location on the storage
72 .. java:method:: public native long read(long size, long nMemb)
75 Read elements of a file.
77 :param size: of each element
78 :param nMemb: is the number of elements of data to write
79 :return: the actually read size
84 .. java:method:: public native void seek(long offset, long origin)
87 Write elements into a file.
89 :param offset: : number of bytes to offset from origin
90 :param 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)
95 .. java:method:: public native long write(long size, long nMemb)
98 Write elements into a file.
100 :param size: of each element
101 :param nMemb: is the number of elements of data to write
102 :return: the actually written size