update known issue

This commit is contained in:
2026-09-01 11:20:35 +09:00
parent e727d3bf14
commit 0d6512c842
2 changed files with 11 additions and 15 deletions
+5 -4
View File
@@ -98,11 +98,12 @@ bool MyZip::FinalizeZip()
this->EOCDR.sizeOfCentralDir += (sizeof(p.header) + p.header.lengthOfFileName); this->EOCDR.sizeOfCentralDir += (sizeof(p.header) + p.header.lengthOfFileName);
} }
auto offset = static_cast<uint32_t>(fileOut.tellp()); auto offset = fileOut.tellp();
if (offset == static_cast<std::streampos>(-1)) if (offset == static_cast<std::streampos>(-1))
{ {
printf("[ ERROR ](FinalizeZip) Failed to get offset"); printf("[ ERROR ](FinalizeZip) Failed to get offset");
fileOut.close(); fileOut.close();
return false;
} }
this->EOCDR.offsetCentralDir = static_cast<uint32_t>(offset); this->EOCDR.offsetCentralDir = static_cast<uint32_t>(offset);
@@ -115,7 +116,7 @@ bool MyZip::FinalizeZip()
if (fileOut.fail()) if (fileOut.fail())
{ {
printf("[ ERROR ](FinalizeZip) Disk write failed while writing central directory entries (Disk full?)\n"); printf("[ ERROR ](FinalizeZip) Disk write failed \n");
fileOut.close(); fileOut.close();
return false; return false;
} }
@@ -125,7 +126,7 @@ bool MyZip::FinalizeZip()
fileOut.write(reinterpret_cast<const char *>(&this->EOCDR), sizeof(this->EOCDR)); fileOut.write(reinterpret_cast<const char *>(&this->EOCDR), sizeof(this->EOCDR));
if (fileOut.fail()) if (fileOut.fail())
{ {
printf("[ ERROR ](FinalizeZip) Disk write failed while writing EOCDR\n"); printf("[ ERROR ](FinalizeZip) Disk write failed \n");
fileOut.close(); fileOut.close();
return false; return false;
} }
@@ -134,7 +135,7 @@ bool MyZip::FinalizeZip()
fileOut.close(); fileOut.close();
if (fileOut.fail()) if (fileOut.fail())
{ {
printf("[ ERROR ](FinalizeZip) Failed to close/flush file (Disk full?)\n"); printf("[ ERROR ](FinalizeZip) Failed to close/flush file (Maybe Disk full?)\n");
return false; return false;
} }
} }
+6 -11
View File
@@ -48,7 +48,8 @@ bool FileReader(MyZip &zip, std::string strInputPath, const std::filesystem::pat
OutputDebugStringA(strDbg.c_str()); OutputDebugStringA(strDbg.c_str());
auto absPathOjb = filesystem::absolute(pathObj); auto absPathOjb = filesystem::absolute(pathObj);
bRet = zip.AddFileToZip(absPathOjb.generic_string(), rootPath.generic_string()); auto relativePath = filesystem::relative(pathObj, rootPath);
bRet = zip.AddFileToZip(absPathOjb.generic_string(), relativePath.generic_string());
break; break;
} }
@@ -127,25 +128,19 @@ int main(int argc, char* argv[])
/** /**
[-Known Issue-] [-Known Issue-]
1. 입력 경로의 상위 디렉터리 전체가 불필요하게 중첩 폴더로 생성되는 현상 1. 폴더 순회구조의 문제
- 현상 : 단일 파일 경로 지정 시, 드라이브 및 상위 디렉터리 계층(d:\MyCode\4_Doc\...)이
압축 파일 내부에 그대로 중첩 생성됨
- 원인 : 입력 경로를 상대 경로로 정규화하지 않고 절대 경로 전체를 압축 내부 엔트리 경로로 사용
- 기대값 : 입력 파일 (혹은 디렉토리) 만 압축되어 저장.
2. 폴더 순회구조의 문제
- 문제 : 전역변수(g_recursive_counter)및 함수(FileReader) 의 전역사용 - 문제 : 전역변수(g_recursive_counter)및 함수(FileReader) 의 전역사용
- 기대값 : 폴더 순회구조 또한 클래스화 - 기대값 : 폴더 순회구조 또한 클래스화
3. CentralDirectory 설계문제 2. CentralDirectory 설계문제
- 문제 : CentralDirectory 를 채우는 코드가 분산됨. - 문제 : CentralDirectory 를 채우는 코드가 분산됨.
- 기대값 : 한 곳으로 집중. - 기대값 : 한 곳으로 집중.
4. 내부 상태 플래그 (bRet) 의 미구현 3. 내부 상태 플래그 (bRet) 의 미구현
- 현상 : 프로그램의 실패 상황 별 플래그값인 "bool bRet" 의 미구현 - 현상 : 프로그램의 실패 상황 별 플래그값인 "bool bRet" 의 미구현
- 기대값 : 일반적인 error code 로써 동작하는 리턴 값으로 사용. - 기대값 : 일반적인 error code 로써 동작하는 리턴 값으로 사용.
5. 예외처리 설계 및 구현의 부재 4. 예외처리 설계 및 구현의 부재
- 현상 : File I/O, 경로검사 등 일관된 형식의 예외처리와 Message 처리가 없음. - 현상 : File I/O, 경로검사 등 일관된 형식의 예외처리와 Message 처리가 없음.
- 기대값 : 에러 조기발견 - 기대값 : 에러 조기발견