#tar chaining
- From: Gustavo Noronha Silva <kov debian org>
- To: GNOME VFS <gnome-vfs-list gnome org>
- Subject: #tar chaining
- Date: Fri, 24 Jan 2003 15:29:07 -0200
Hi friends,
I was trying to see a tar.gz with nautilus. I was actually reading some
developer-oriented documentation and came across an example like this:
file:///home/kov/download/koth.tar.gz#gzip#tar/src/hello.c
Using this:
file:///home/kov/download/koth.tar#tar/
Nautilus simply keeps 'doing something' and nothing happens.
I then wrote this code:
#!/usr/bin/python
import pygtk
pygtk.require ('2.0')
import gnome
from gnome import vfs
import os
uri = vfs.URI ('file:///home/kov/download/koth-0.7.7.tar#tar/')
arquivo = vfs.open (uri, vfs.OPEN_READ)
str = arquivo.read (arquivo.get_file_info().size)
tar = os.popen('tar xv', 'w')
tar.write (str)
arquivo.close ()
As you see I have to pass 'str' to a real tar command to be able to
extract it. If I understand gnome-vfs correctly, I should be able
to open that URI as a directory, but vfs.open_directory is not
possible:
>>> uri.toplevel
<gnome.vfs.URI 'file:///home/kov/download/koth-0.7.7.tar#tar/'>
>>> h = vfs.open_directory (uri)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
gnome.vfs.error: Not a directory
Is the chaining simply not working? Nautilus actually *does* open
libtar.so when 'doing something', and using #gzip on a error.txt.gz
file gives me the same results.
I am trying to understand all this methods, modules and vfs stuff
as a programmer. As I understand it, implementing the right stuff
on gnome-vfs should have nautilus working properly with no extra
code. Right?
Thanks,
[]s!
--
kov debian org: Gustavo Noronha <http://people.debian.org/~kov>
Debian: <http://www.debian.org> * <http://www.debian-br.org>
Dúvidas sobre o Debian? Visite o Rau-Tu: http://rautu.cipsga.org.br
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]