2

I am extracting a number of .tar.gz files using a batch script in Windows. The tar files are all different data sets and should generally have the same directory and file structure, just with different content. When I checked on the status this morning, I noticed that certain files are failing for every tar file. The error I'm seeing in the terminal is the following, and repeated for every tar file:

Folder1/data/Dictionary.dic: Can't create '\\\\?\\D:\\Full\\Path\\to the\\Folder1\\data\\Dictionary.dic'
Folder1/data/data_Dictionary.dic: Can't create '\\\\?\\D:\\Full\\Path\\to the\\Folder1\\data\\data_Dictionary.dic'
tar: Error exit delayed due to previous errors

Everything else in the repository seems to be extracting correctly, including files destined for the same folder, except for these two files. In case it matters, these files are both .dic, which is a text file.

Any reason why these files are failing to extract? Is there a way to extract only these specific files after the fact? There's about 1.5TB of data to extract, which can take a day or two, and I don't want to have to run the whole thing again.

1
  • not exactly the same, but for those that are having a similar issue, check to see if the files that are failing the extract are symlinks. i did this by trying to extract one using 7zip, and it gave me a more clear error message. if they are, see this post. try extracting as admin, or enable windows developer mode as mentioned here Commented Jul 28, 2023 at 22:36

1 Answer 1

0

The tar archives were most likely created on Linux and are now being unpacked on Windows.

As file and folder names on Linux may contain characters that are illegal as such under Windows, this is probably the problem here.

The Microsoft article Naming Files, Paths, and Namespaces lists the reserved characters:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)

As a workaround, you could install WSL and a Linux distribution on Windows and unpack the files in there.

See Windows Subsystem for Linux Installation Guide for Windows 10.

5
  • This is great advice. He is probably correct. I would add to it that 7zip might be able to give you a more informed error (for troubleshooting). Commented Jun 30, 2021 at 14:00
  • You're right that the original was probably created on Linux. I don't believe the filenames are using any special characters though. I updated my question to give more representative examples of the filenames I'm using and the output from the errors.
    – David K
    Commented Jun 30, 2021 at 14:31
  • @SeñorCMasMas I have 7zip installed, which I believe is how the tar command is available to me. In the past I've only been able to use 7zip to extract the .gz first, and then a second step to get the .tar. Is there a way to do both in one step?
    – David K
    Commented Jun 30, 2021 at 14:33
  • Many products are able to directly unpack .tar.gz files. My favorite one is Bandizip.
    – harrymc
    Commented Jun 30, 2021 at 15:50
  • Nice! Thanks for the tip @harrymc .. :) Yes.. that has always bugged me but I am still a fan of the product. Commented Jun 30, 2021 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .