void TarWriter::addADS(const std::wstring& path) std::wstring streamPath = path + L":Zone.Identifier"; HANDLE h = CreateFileW(streamPath.c_str(), GENERIC_READ, ...); if (h != INVALID_HANDLE_VALUE) // Store as separate entry with name "path:Zone.Identifier" addFile(streamPath, ToUtf8(path) + ":Zone.Identifier");
// Windows-specific mode mapping header.mode[0] = '0'; header.mode[1] = info.isReadOnly ? '4' : '6'; strcpy(header.magic, "ustar"); tar utility for windows
else if (hdr.typeflag == '2') // symlink std::wstring target = Utf8ToWide(hdr.linkname); CreateSymbolicLinkW(fullPath.c_str(), target.c_str(), IsDirectory(target) ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0); HANDLE h = CreateFileW(streamPath.c_str()
class FilterStream virtual size_t read(BYTE* buf, size_t len) = 0; virtual size_t write(BYTE* buf, size_t len) = 0; ; class GzipFilter : public FilterStream z_stream zs; // inflate/deflate with Z_SYNC_FLUSH ; ToUtf8(path) + ":Zone.Identifier")
// ... other types Use streaming architecture to avoid loading entire archive into memory:
void TarWriter::addADS(const std::wstring& path) std::wstring streamPath = path + L":Zone.Identifier"; HANDLE h = CreateFileW(streamPath.c_str(), GENERIC_READ, ...); if (h != INVALID_HANDLE_VALUE) // Store as separate entry with name "path:Zone.Identifier" addFile(streamPath, ToUtf8(path) + ":Zone.Identifier");
// Windows-specific mode mapping header.mode[0] = '0'; header.mode[1] = info.isReadOnly ? '4' : '6'; strcpy(header.magic, "ustar");
else if (hdr.typeflag == '2') // symlink std::wstring target = Utf8ToWide(hdr.linkname); CreateSymbolicLinkW(fullPath.c_str(), target.c_str(), IsDirectory(target) ? SYMBOLIC_LINK_FLAG_DIRECTORY : 0);
class FilterStream virtual size_t read(BYTE* buf, size_t len) = 0; virtual size_t write(BYTE* buf, size_t len) = 0; ; class GzipFilter : public FilterStream z_stream zs; // inflate/deflate with Z_SYNC_FLUSH ;
// ... other types Use streaming architecture to avoid loading entire archive into memory: