changes.
[IRC.git] / Robust / Transactions / NativeFuntions.c
1 /* 
2  * File:   HelloWorld.cpp
3  * Author: navid
4  *
5  * Created on September 3, 2008, 2:17 PM
6  */
7
8         #include <jni.h>
9         #include <stdio.h>
10         #include <sys/stat.h>
11         #include "NativeFunctions.h"
12         
13         JNIEXPORT jlong JNICALL Java_TransactionalFileWrapperFactory_getINodeNative
14             (JNIEnv *env, jobject obj, jstring filename) 
15         {
16             struct stat status_buf;
17             jlong inodenum;
18            // stat("/home/navid/myfile.txt",&status_buf);
19             char *str = (*env)->GetStringUTFChars(env, filename, 0);
20             printf("File Name is: %s \n", str);
21             stat(str,&status_buf);
22             printf("Inode number is: %lu \n", status_buf.st_ino);
23             inodenum = status_buf.st_ino;
24             return inodenum;
25         }
26