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 | |
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')
3 files changed, 38 insertions, 0 deletions
diff --git a/android/ultimate/get_modification_time/jni/Android.mk b/android/ultimate/get_modification_time/jni/Android.mk new file mode 100644 index 00000000000..f9092b41024 --- /dev/null +++ b/android/ultimate/get_modification_time/jni/Android.mk @@ -0,0 +1,22 @@ +# Copyright (C) 2009 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := get_modification_time +LOCAL_SRC_FILES := get_modification_time.c + +include $(BUILD_EXECUTABLE) diff --git a/android/ultimate/get_modification_time/jni/Application.mk b/android/ultimate/get_modification_time/jni/Application.mk new file mode 100644 index 00000000000..a252a72d729 --- /dev/null +++ b/android/ultimate/get_modification_time/jni/Application.mk @@ -0,0 +1 @@ +APP_ABI := all 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; +} + |