File: glob.py

package info (click to toggle)
libewf 20140816-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,940 kB
  • sloc: ansic: 347,781; sh: 8,203; cpp: 3,819; makefile: 2,096; yacc: 1,104; python: 439; lex: 394; sed: 16
file content (51 lines) | stat: -rwxr-xr-x 1,069 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /usr/bin/env python
#
# Python script to glob Expert Witness Compression format file(s) using pyewf
#
# Author:            Joachim Metz
# Creation date:     October 14, 2010
# Modification date: January 20, 2010
#

__author__    = "Joachim Metz"
__version__   = "20130120"
__date__      = "Jan 20, 2013"
__copyright__ = "Copyright (c) 2006-2013, Joachim Metz <joachim.metz@gmail.com>"
__license__   = "GNU LGPL version 3"

import sys
import pyewf

# ----------------------------------------------------------------------------
# Main
# ----------------------------------------------------------------------------

print "glob.py " + __version__ + " (libewf " + pyewf.get_version() + ")\n"

argc = len( sys.argv )

if argc != 2:
	print "Usage: glob.py filename\n"

	sys.exit( 1 )

try:
	filenames = pyewf.glob(
	             sys.argv[ 1 ] )

except:
	print "Unable to glob filename(s)\n"
	print sys.exc_info()[ 1 ]

	sys.exit( 1 )

if len( filenames ) > 0:
	print "Filenames:"

	for filename in filenames:
		print filename.encode( "utf8" )

	print ""

sys.exit( 0 )