OSDN Git Service

TPI_FILEINFOにパーミッション、ユーザ、グループの各要素を追加。
authorsirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Wed, 3 Nov 2010 13:12:45 +0000 (13:12 +0000)
committersirakaba <sirakaba@9df91469-1e22-0410-86e7-ea8537beb833>
Wed, 3 Nov 2010 13:12:45 +0000 (13:12 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tpi/tpi@415 9df91469-1e22-0410-86e7-ea8537beb833

doc/history.html
src/common/handle/TPIHandle.cpp
src/common/header/plugin.h
src/plugin/7zArc/7zArc.cpp

index d5025c5..aa85277 100644 (file)
    <dd>\r
     Ver.0.01&beta;9\r
     <dl>\r
+     <dt>TPI</dt>\r
+     <dd>\r
+      <ul>\r
+       <li class="add">TPI_FILEINFOにパーミッション、ユーザ、グループの各要素を追加。</li>\r
+      </ul>\r
+     </dd>\r
      <dt>Lychee</dt>\r
      <dd>\r
       <ul>\r
index 3180243..b226088 100644 (file)
@@ -154,20 +154,23 @@ bool TPIHandle::GetFileInformation(TPI_FILEINFO * _fiInfo, bool _bFirst)
        }\r
 \r
        // Initialization.\r
+       _fiInfo->eDanger        = 0;\r
+       _fiInfo->eOSType        = 0;\r
+       _fiInfo->wCompressRatio = 0;\r
+       _fiInfo->wPermission    = 0644;\r
        _fiInfo->dwAttribute    = 0;\r
        _fiInfo->dwCRC32        = 0;\r
        _fiInfo->tmAccess       = 0;\r
        _fiInfo->tmCreate       = 0;\r
        _fiInfo->tmModified     = 0;\r
-       _fiInfo->eDanger        = 0;\r
-       _fiInfo->eOSType        = 0;\r
        _fiInfo->nPackedSize    = 0;\r
        _fiInfo->nUnpackedSize  = 0;\r
        _fiInfo->fnFileName.Clear();\r
        _fiInfo->szStoredName.Empty();\r
        _fiInfo->szMethod.Empty();\r
        _fiInfo->szComment.Empty();\r
-       _fiInfo->wCompressRatio = 0;\r
+       _fiInfo->szUser.Empty();\r
+       _fiInfo->szGroup.Empty();\r
        _fiInfo->nFileId        = 0;\r
        _fiInfo->pCustomInfo    = NULL;\r
 \r
index 7390d23..e616023 100644 (file)
@@ -281,6 +281,7 @@ typedef struct _TPI_tagFILEINFO
        unsigned short  eDanger;                /**< セキュリティ警告 */\r
        unsigned short  eOSType;                /**< 作成元OS */\r
        unsigned short  wCompressRatio;         /**< 圧縮率 */\r
+       unsigned short  wPermission;            /**< パーミッション */\r
        /** 属性 */\r
        /** @sa c_file_attribute */\r
        unsigned long   dwAttribute;\r
@@ -295,6 +296,8 @@ typedef struct _TPI_tagFILEINFO
        wxString        szStoredName;           /**< 格納された名前 */\r
        wxString        szMethod;               /**< 格納メソッド */\r
        wxString        szComment;              /**< コメント */\r
+       wxString        szUser;                 /**< ユーザ */\r
+       wxString        szGroup;                /**< グループ */\r
        void *          pCustomInfo;            /**< 任意の情報を格納 */\r
 }      TPI_FILEINFO;\r
 \r
index 3d40b42..ff7021b 100644 (file)
@@ -69,6 +69,13 @@ int GetFileInformation2(void * _hArchive, TPI_FILEINFO * _fiInfo, wxULongLong_t
        {\r
                _fiInfo->dwAttribute |= TPI_ATTRIBUTE_DIRECTORY;\r
        }\r
+       hArc->GetProperty(nIndex, kpidPosixAttrib, & prop);\r
+       _fiInfo->wPermission    = prop.vt == VT_EMPTY ? 0644 : prop.uintVal;\r
+       hArc->GetProperty(nIndex, kpidEncrypted, & prop);\r
+       if (prop.vt == VT_BOOL && VARIANT_BOOLToBool(prop.boolVal))\r
+       {\r
+               _fiInfo->dwAttribute |= TPI_ATTRIBUTE_ENCRYPTED;\r
+       }\r
        hArc->GetProperty(nIndex, kpidCRC, & prop);\r
        _fiInfo->dwCRC32        = prop.ulVal;\r
        hArc->GetProperty(nIndex, kpidPackSize, & prop);\r
@@ -117,16 +124,10 @@ int GetFileInformation2(void * _hArchive, TPI_FILEINFO * _fiInfo, wxULongLong_t
                _fiInfo->szStoredName = wxT("data") + (prop.vt == VT_BSTR ? wxT(".") + WC2String(prop.bstrVal) : (wxString) wxEmptyString);\r
        }\r
        _fiInfo->fnFileName     = wxFileName(_fiInfo->szStoredName, wxPATH_DOS);\r
-       hArc->GetProperty(nIndex, kpidMethod, & prop);\r
-       if (prop.vt == VT_BSTR)\r
-       {\r
-               _fiInfo->szMethod = WC2String(prop.bstrVal);\r
-       }\r
-       hArc->GetProperty(nIndex, kpidComment, & prop);\r
-       if (prop.vt == VT_BSTR)\r
-       {\r
-               _fiInfo->szComment  = WC2String(prop.bstrVal);\r
-       }\r
+       hArc->GetProperty(nIndex, kpidMethod,  & prop); _fiInfo->szMethod   = prop.vt == VT_BSTR ? WC2String(prop.bstrVal) : (wxString) wxEmptyString;\r
+       hArc->GetProperty(nIndex, kpidComment, & prop); _fiInfo->szComment  = prop.vt == VT_BSTR ? WC2String(prop.bstrVal) : (wxString) wxEmptyString;\r
+       hArc->GetProperty(nIndex, kpidUser,    & prop); _fiInfo->szUser     = prop.vt == VT_BSTR ? WC2String(prop.bstrVal) : (wxString) wxEmptyString;\r
+       hArc->GetProperty(nIndex, kpidComment, & prop); _fiInfo->szGroup    = prop.vt == VT_BSTR ? WC2String(prop.bstrVal) : (wxString) wxEmptyString;\r
        _fiInfo->nFileId        = nIndex;\r
        return TPI_ERROR_SUCCESS;\r
 }\r
@@ -526,6 +527,9 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(int nResult)
        if (this->nMode == NArchive::NExtract::NAskMode::kExtract)\r
        {\r
                NWindows::NFile::NDirectory::MySetFileAttributes(this->piInfo.fnDestination.GetFullPath(), this->piInfo.fiInfo.dwAttribute);\r
+#ifdef __LINUX__\r
+               _wchmod(this->piInfo.fnDestination.GetFullPath().c_str());\r
+#endif\r
        }\r
 \r
        return S_OK;\r