Commit da6c46cc authored by Jeroen F.J. Laros's avatar Jeroen F.J. Laros

More explicit naming of files.

parent 7fb07c0b
......@@ -34,11 +34,11 @@ class StreamMeta(object):
self._log_message()
def _current_file(self):
return 'file_{:04d}'.format(self._index)
return 'chunk_{:04d}'.format(self._index)
def _log_message(self):
self._log_handle.write(
'Calculating checksum for file: {}\n'.format(self._current_file()))
self._log_handle.write('Calculating checksum for chunk: {}\n'.format(
self._current_file()))
def write(self, data):
self._len += len(data)
......@@ -244,7 +244,7 @@ def _make_stream_metadata(log_handle, directory, title):
'size': len(readme)})
metadata['tags'] = {
'directory': True,
'note': 'Unpack with: `cat file_* | tar -xzv`'}
'note': 'Unpack with: `cat chunk_* | tar -xzv`'}
stream_metadata = StreamMeta(log_handle)
_tgz_stream(stream_metadata, directory)
......@@ -353,7 +353,7 @@ def transfer_dir(log_handle, directory, server_name, user_id, title, ssl_check):
transfer_client.uploads(user_id, transfer_id, readme)
for item in metadata['files'][1:]:
log_handle.write('Uploading file: {}\n'.format(item['filename']))
log_handle.write('Uploading chunk: {}\n'.format(item['filename']))
pipe.name = item['filename']
pipe.set_size(item['size'])
transfer_client.uploads(user_id, transfer_id, pipe)
......@@ -423,13 +423,13 @@ def resume_dir(log_handle, directory, server_name, user_id, ssl_check):
for file_object in transfer['files'][1:]:
if file_object['status'] == 'pending':
log_handle.write(
'Uploading file: {}\n'.format(file_object['filename']))
'Uploading chunk: {}\n'.format(file_object['filename']))
pipe.name = file_object['filename']
pipe.set_size(file_object['size']) # This key is missing.
transfer_client.uploads(user_id, transfer_id, pipe)
else:
log_handle.write(
'Skipping file: {}\n'.format(file_object['filename']))
'Skipping chunk: {}\n'.format(file_object['filename']))
pipe.read(file_object['size']) # This requires memory?
......
......@@ -7,16 +7,16 @@ into equally sized chunks in order to transfer it.
To unpack, use the following command:
```bash
cat file_* | tar -xzv
cat chunk_* | tar -xzv
```
Alternatively first reconstruct the archive:
```bash
cat file_* > data.tgz
cat chunk_* > data.tgz
tar -xzvf data.tgz
```
To inspect the content of the archive, use the command:
```bash
cat file_* | tar -tzv
cat chunk_* | tar -tzv
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment