OSDN Git Service

add tsid channel information for complete BS support.
[rec10/rec10-git.git] / rec10 / trunk / src / zip.py
1 #!/usr/bin/python
2 # coding: UTF-8
3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009-2011 Yukikaze
5
6 import os
7 import os.path
8 import zipfile
9
10 def addFile2FileZip(addfile,basefile):
11     th=0
12
13     if os.path.exists(basefile):
14         th=zipfile.ZipFile(basefile,'a',zipfile.ZIP_DEFLATED)
15     else:
16         th=zipfile.ZipFile(basefile,'w',zipfile.ZIP_DEFLATED)
17     if os.path.exists(addfile):
18         th.write(addfile,os.path.basename(addfile))
19     th.close()