From 3ee47bc2ab41e5bf10774fc7f06ae6ca43d7e78e Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Fri, 25 Jan 2013 21:47:37 +0000 Subject: file manager updates for exFAT Change-Id: I06fa6120a975cbc3d4eef9bc2ca034ec716740ee --- twrp-functions.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'twrp-functions.cpp') 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 -- cgit v1.2.3