Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Issue 159129: Refactor tar code to support long names.... (Closed)

Created:
11 years, 5 months ago by gman
Modified:
9 years, 7 months ago
Reviewers:
Chris Rogers
CC:
o3d-review_googlegroups.com
Visibility:
Public.

Description

Refactor tar code to support long names. The previous code only support names up to 99 chars. This one supports up to 1024. The code actually supports 32bit length but given that Linux, OSX and other only support 255 I set it 1024. Why 1024? Because Windows actually supports 255 wchar characters which when converted to utf-8 could be up to 1024 bytes. I'm not 100% sure the format is correct. I could not find any docs on the format, Just reverse engineered it. Looking at hex dumps by both 7zip and gnu tar it was pretty clear what it does including zeroing many of the standard fields. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=21210

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -58 lines) Patch
M import/cross/tar_generator.h View 2 chunks +13 lines, -4 lines 3 comments Download
M import/cross/tar_generator.cc View 6 chunks +58 lines, -19 lines 2 comments Download
M import/cross/tar_generator_test.cc View 6 chunks +40 lines, -9 lines 0 comments Download
M import/cross/tar_processor.h View 3 chunks +5 lines, -1 line 0 comments Download
M import/cross/tar_processor.cc View 4 chunks +48 lines, -19 lines 1 comment Download
M import/cross/tar_processor_test.cc View 2 chunks +14 lines, -6 lines 0 comments Download
M tests/archive_files/test1.tar View Binary file 0 comments Download

Messages

Total messages: 2 (0 generated)
gman
11 years, 5 months ago (2009-07-21 06:34:57 UTC) #1
Chris Rogers
11 years, 5 months ago (2009-07-21 19:14:28 UTC) #2
LGTM - I'd add a few comments where I've noted...

http://codereview.chromium.org/159129/diff/1/6
File import/cross/tar_generator.cc (right):

http://codereview.chromium.org/159129/diff/1/6#newcode57
Line 57: static const char* kLongLink = "././@LongLink";
comment explaining what kLongLink is

http://codereview.chromium.org/159129/diff/1/6#newcode131
Line 131: // for our use case
maybe should adjust comment to say this can indicate a directory, ordinary file,
or long filename

http://codereview.chromium.org/159129/diff/1/3
File import/cross/tar_generator.h (right):

http://codereview.chromium.org/159129/diff/1/3#newcode70
Line 70: virtual bool AddFile(const String &file_name,
add comment about return value

http://codereview.chromium.org/159129/diff/1/3#newcode82
Line 82: bool AddEntry(const String &file_name,
add comment about return value

http://codereview.chromium.org/159129/diff/1/3#newcode86
Line 86: bool AddDirectory(const String &file_name);
comment about return value

http://codereview.chromium.org/159129/diff/1/7
File import/cross/tar_processor.cc (right):

http://codereview.chromium.org/159129/diff/1/7#newcode66
Line 66: // The tar format stupidly represents size_teger values as
might as well fix this comment now "size_teger"

Powered by Google App Engine
This is Rietveld 408576698