summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-25 22:47:37 +0100
committerDees_Troy <dees_troy@teamw.in>2013-01-28 16:20:03 +0100
commit3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e (patch)
treeaecfd88ef42f1e696c788ab2ff1110ac009b3807 /twrp-functions.cpp
parentRemove thread logging from actions.cpp (diff)
downloadandroid_bootable_recovery-3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e.tar
android_bootable_recovery-3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e.tar.gz
android_bootable_recovery-3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e.tar.bz2
android_bootable_recovery-3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e.tar.lz
android_bootable_recovery-3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e.tar.xz
android_bootable_recovery-3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e.tar.zst
android_bootable_recovery-3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e.zip
Diffstat (limited to 'twrp-functions.cpp')
-rw-r--r--twrp-functions.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index edf4898b1..5473c8d66 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -453,3 +453,24 @@ int TWFunc::copy_file(string src, string dst, int mode) {
dstfile.close();
return 0;
}
+
+unsigned int TWFunc::Get_D_Type_From_Stat(string Path) {
+ struct stat st;
+
+ stat(Path.c_str(), &st);
+ if (st.st_mode & S_IFDIR)
+ return DT_DIR;
+ else if (st.st_mode & S_IFBLK)
+ return DT_BLK;
+ else if (st.st_mode & S_IFCHR)
+ return DT_CHR;
+ else if (st.st_mode & S_IFIFO)
+ return DT_FIFO;
+ else if (st.st_mode & S_IFLNK)
+ return DT_LNK;
+ else if (st.st_mode & S_IFREG)
+ return DT_REG;
+ else if (st.st_mode & S_IFSOCK)
+ return DT_SOCK;
+ return DT_UNKNOWN;
+} \ No newline at end of file