K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / share / doc / python-debian / examples / debfile /
server ip : 172.67.156.115

your ip : 172.70.80.98

H O M E


Filename/usr/share/doc/python-debian/examples/debfile/ar
Size1.32 kb
Permissionrwxr-xr-x
Ownerroot : root
Create time27-Apr-2025 09:53
Last modified22-Aug-2012 23:26
Last accessed27-Apr-2025 09:52
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
#!/usr/bin/python

# ar.py: ar emulation using ArFile
# Copyright (C) 2007 Filippo Giunchedi <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from __future__ import print_function

import os
import sys

from debian import arfile

if __name__ == '__main__':
if len(sys.argv) < 3:
print("usage: arfile.py [tp] <arfile>")
sys.exit(1)

if not os.path.exists(sys.argv[2]):
print("please provide a file to operate on")
sys.exit(1)

a = arfile.ArFile(sys.argv[2])

if sys.argv[1] == 't':
print("\n".join(a.getnames()))
elif sys.argv[1] == 'p':
for m in a.getmembers():
#print("".join(m.readlines()))
sys.stdout.write("".join(m.readlines()))