Changeset 2933 in vbox
- Timestamp:
- May 30, 2007 2:56:43 PM (18 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/fs.cpp
r1 r2933 33 33 #include <iprt/time.h> 34 34 #include <iprt/string.h> 35 #include <iprt/path.h> 35 36 #include <iprt/ctype.h> 36 37 #include "internal/fs.h" … … 90 91 * @param fMode The mode mask containing dos-style attibutes only. 91 92 */ 92 RTFMODE rtFsModeFromUnix(RTFMODE fMode )93 RTFMODE rtFsModeFromUnix(RTFMODE fMode, const char *pszName, unsigned cbName) 93 94 { 94 95 fMode &= RTFS_UNIX_MASK; … … 100 101 if (!(fMode & RTFS_DOS_MASK)) 101 102 fMode |= RTFS_DOS_NT_NORMAL; 103 if (!(fMode & RTFS_DOS_HIDDEN) && pszName) 104 { 105 pszName = RTPathFilename(pszName); 106 if (pszName && *pszName == '.') 107 fMode |= RTFS_DOS_HIDDEN; 108 } 102 109 return fMode; 103 110 } … … 117 124 rtFsModeFromDos(fMode, pszName, cbName); 118 125 else if (!(fMode & RTFS_DOS_MASK)) 119 rtFsModeFromUnix(fMode );126 rtFsModeFromUnix(fMode, pszName, cbName); 120 127 else if (!(fMode & RTFS_TYPE_MASK)) 121 128 fMode |= fMode & RTFS_DOS_DIRECTORY ? RTFS_TYPE_DIRECTORY : RTFS_TYPE_FILE; … … 169 176 * @param pStat The stat structure to use. 170 177 */ 171 void rtFsConvertStatToObjInfo(PRTFSOBJINFO pObjInfo, const struct stat *pStat )178 void rtFsConvertStatToObjInfo(PRTFSOBJINFO pObjInfo, const struct stat *pStat, const char *pszName, unsigned cbName) 172 179 { 173 180 pObjInfo->cbObject = pStat->st_size; … … 246 253 Assert(RTFS_TYPE_MASK == S_IFMT); 247 254 248 pObjInfo->Attr.fMode = rtFsModeFromUnix(fMode );255 pObjInfo->Attr.fMode = rtFsModeFromUnix(fMode, pszName, cbName); 249 256 250 257 /* additional unix attribs */ -
trunk/src/VBox/Runtime/include/internal/fs.h
r1 r2933 31 31 32 32 RTFMODE rtFsModeFromDos(RTFMODE fMode, const char *pszName, unsigned cbName); 33 RTFMODE rtFsModeFromUnix(RTFMODE fMode );33 RTFMODE rtFsModeFromUnix(RTFMODE fMode, const char *pszName, unsigned cbName); 34 34 RTFMODE rtFsModeNormalize(RTFMODE fMode, const char *pszName, unsigned cbName); 35 35 bool rtFsModeIsValid(RTFMODE fMode); … … 38 38 size_t rtPathVolumeSpecLen(const char *pszPath); 39 39 #ifndef __WIN__ 40 void rtFsConvertStatToObjInfo(PRTFSOBJINFO pObjInfo, const struct stat *pStat );40 void rtFsConvertStatToObjInfo(PRTFSOBJINFO pObjInfo, const struct stat *pStat, const char *pszName, unsigned cbName); 41 41 #endif 42 42 -
trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp
r1387 r2933 425 425 * Setup the returned data. 426 426 */ 427 rtFsConvertStatToObjInfo(pObjInfo, &Stat );427 rtFsConvertStatToObjInfo(pObjInfo, &Stat, NULL, 0); 428 428 429 429 /* -
trunk/src/VBox/Runtime/r3/posix/path-posix.cpp
r937 r2933 337 337 # else 338 338 int cchLink = readlink("/proc/curproc/file", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1); 339 # endif 339 # endif 340 340 if (cchLink < 0 || cchLink == sizeof(g_szrtProgramPath) - 1) 341 341 { … … 465 465 if (!stat(pszNativePath, &Stat)) 466 466 { 467 rtFsConvertStatToObjInfo(pObjInfo, &Stat );467 rtFsConvertStatToObjInfo(pObjInfo, &Stat, pszPath, 0); 468 468 switch (enmAdditionalAttribs) 469 469 {
Note:
See TracChangeset
for help on using the changeset viewer.