[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Kioslave big patch
From:       Sven Radej <sven () lisa ! exp ! univie ! ac ! at>
Date:       1999-01-19 8:53:03
[Download RAW message or body]



On Tue, 19 Jan 1999, David Faure wrote:

> Sven,
> 
> I'm digging out of your patch the part about tar.*
> 
> First question : why the following bit of code ?
> 
>     QString Command( "tar -%stvf -");
>     if (dirpath[0] != '\0')
>     {
>       Command += " \"";
>       Command += dirpath;
>       Command += "\"";
>     }
> 
> This creates a command such as "tar -tvzf - <dirpath>"
> If you give '-' as input file, what is dirpath good for ?

If you give a dirpath tar returns only entries that contain that dirpath.
Otherwise you get a listing of entire archive.
'dirpath' is not the name of archive it is a match. I didn't find where
filename of archive is piped into tar :-o - maybe in parentProtocol (tar
is subprotocol).

> BTW, is testing [0]!='\0' equivalent to testing !isEmpty() ?
> (I think so...) I think it is. isNull tests if QString's data isn't
initialized.

> 
> > tar.cpp;h
> > I completely changed openDir, readDir and fiddled with open and read. OpenDir
> > now reads all items from dir, and stores it into list; readDir gets things
> > from the list (before readDir passed whole archive through tar to get next
> > item). Wery important, OpenDir returns FAIL if url is file and not a dir.
> > It is possible now to add write, mkdir and delete to tar proto.
> > This is still not fantastc; this proto should read tar list on creation so
> > that openDir doesn't require tarring archive every time; also this would
> > enable to get size of opened file.
> Right. I'll see what I can do.
> 
> There is a problem when parent directories are not in the tar file (which
> is very common).
I didn't know that :-(

> They have to be emulated somehow, because otherwise the tar.gz contents
> appear empty.

after striping dirpath from entry that's just read from tar, OpenDir
looks for usr/'\0' 

You could take first usr/ and discard all other usr/a, usr/b... 

Or something like that.
--
sven

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic