Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Mark Larson
Dec 27, 2003

Interesting...
I had multiple small zip files scattered across several folders, and I used this command to find them all and put them into one folder:

code:
find . -name "sa_forums_dataset*" -exec mv -v {} ./sa_forums_dataset \;
However, you might have noticed that I didn't have a trailing backslash after the folder name, and a file or folder with that name didn't already exist. Therefore Linux* created a new file instead of a new folder, and concatenated all the smaller files into it just gave me one 16MB file, which is smaller than it should be.

How do I get my files back now?

* By Linux I mean Windows 10 WSL (Debian) however the files are on the Windows file system

Adbot
ADBOT LOVES YOU

Hed
Mar 31, 2004

Fun Shoe
It looks like you just clobbered them. If you in fact concatenated you should be able to take advantage of the fact that every PKZIP file starts with a known header.

For example some python I completely haven't tested that could do this is to split on that magic and write the individual files out:
Python code:
INPUT_FILE = 'sa_forums_dataset'
PKZIP_HEADER = b'\x50\x4b\x03\x04'
with open(INPUT_FILE, 'rb') as f:
    data = f.read()

subfiles = data.split(PKZIP_HEADER)

for i, subfile in enumerate(subfiles):
    with open('zip-%d.zip' % i, 'wb') as f:
        f.write(PKZIP_HEADER)
        f.write(subfile)

Hed fucked around with this message at 02:05 on Feb 24, 2019

Mark Larson
Dec 27, 2003

Interesting...
The files are all gone. Luckily I was able to restore from an online backup.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply