Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100638882
ggzip
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Feb 1, 09:45
Size
1009 B
Mime Type
text/x-python
Expires
Mon, Feb 3, 09:45 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24004842
Attached To
rGTOOLS Gtools
ggzip
View Options
#!/usr/bin/python
import
glob
,
sys
,
os
from
optparse
import
OptionParser
########################################
#
# parser
#
########################################
def
parse_options
():
usage
=
"usage: %prog [options] file"
parser
=
OptionParser
(
usage
=
usage
)
parser
.
add_option
(
"--files"
,
action
=
"store"
,
dest
=
"files"
,
type
=
"string"
,
default
=
None
,
help
=
"list of files"
,
metavar
=
" FILES"
)
(
options
,
args
)
=
parser
.
parse_args
()
files
=
args
return
files
,
options
################################################################################
#
# MAIN
#
################################################################################
files
,
opt
=
parse_options
()
files
=
glob
.
glob
(
opt
.
files
)
files
.
sort
()
n
=
len
(
files
)
print
n
,
"files to compress"
i
=
0
for
file
in
files
:
i
=
i
+
1
cmd
=
"gzip
%s
"
%
file
print
"(
%8d
/
%8d
)"
%
(
i
,
n
),
cmd
os
.
system
(
cmd
)
Event Timeline
Log In to Comment