diff options
author | Eugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com> | 2013-10-07 10:36:56 +0400 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2013-10-10 10:07:24 -0700 |
commit | 5ec60f348b1b73004e9c62fc88592a6afd659833 (patch) | |
tree | 0e4c58b04d1403a01723a8c0c6dfab37c9ed97e3 /android/ultimate/get_modification_time/jni/get_modification_time.c | |
parent | c694bba2a8637a147dd9dff8b833a8be816f7baf (diff) | |
download | idea-5ec60f348b1b73004e9c62fc88592a6afd659833.tar.gz |
install command line tool onto device to get exact modification time; use it instead of ls and md5 computation, since md5 may be not available on some devices
Diffstat (limited to 'android/ultimate/get_modification_time/jni/get_modification_time.c')
-rw-r--r-- | android/ultimate/get_modification_time/jni/get_modification_time.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/android/ultimate/get_modification_time/jni/get_modification_time.c b/android/ultimate/get_modification_time/jni/get_modification_time.c new file mode 100644 index 00000000000..0ccd2705029 --- /dev/null +++ b/android/ultimate/get_modification_time/jni/get_modification_time.c @@ -0,0 +1,15 @@ +#include <sys/stat.h> +#include <stdio.h> + +int main(int argc, char** args) { + struct stat st; + char* filename = args[1]; + + if (stat(filename, &st) < 0) { + perror(filename); + return 1; + } + printf("%lu\n", st.st_mtime); + return 0; +} + |