IUBLibTech / bdpl_ingest

Python script for Born Digital Preservation Lab Ingest tool
6 stars 1 forks source link

transferContent: use mmls to check on partitions #10

Closed shallcro closed 5 years ago

shallcro commented 5 years ago

First check: are there partitions?

If no, then use disktype

if yes, then need to consider which tool for which partition

Create separate directory for each partition; loop through dictionary until it's all done

Key elements to track and automate process:

First attempt:

shallcro commented 5 years ago

Gets info in a dictioonary--could then parse through

newlist = []

c = 0 for part in mmls[5:]: ... tempdict = {} ... if any(x.isdigit() for x in part.split()[1]): ... tempdict['part#'] = str(c) ... tempdict['start'] = part.split()[2] ... tempdict['fs'] = part.split()[5] ... newlist.append(tempdict) ... c += 1

ISSUE: partition type is also split...

shallcro commented 5 years ago

This does a better job:

import re

for part in mmls[5:]: ... print(re.split(r'\s\s+', part))

['000:', 'Meta', '0000000000', '0000000000', '0000000001', 'Primary Table (#0)'] ['001:', '-------', '0000000000', '0000000127', '0000000128', 'Unallocated'] ['002:', '000:000', '0000000128', '0000016511', '0000016384', 'DOS FAT12 (0x01)'] ['003:', '000:001', '0000016512', '0000082047', '0000065536', 'DOS FAT16 (0x06)'] ['004:', '000:002', '0000082048', '0000213119', '0000131072', 'Win95 FAT32 (0x0b)'] ['005:', '-------', '0000213120', '0002097152', '0001884033', 'Unallocated']

shallcro commented 5 years ago

Now,:

NOTE: fiwalk starts numbering partitions @ 1 (not 0)