forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Zip view help! [SOLVED]
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Wed Mar 23, 2011 10:54 pm    Post subject: Zip view help! [SOLVED] Reply with quote

Hi forum,
are a lot of week, i'm tring to create a gui to view a zipfile content using the sszip lib.
I would like (I need) to create a view like winzip or winrar files/folder view,
but I don't understand how Stupid Stupid Stupid
someone can help me please?

Many thanks in advance for any info or idea


Last edited by Tdk161 on Mon Apr 25, 2011 11:55 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Thu Mar 24, 2011 5:22 pm    Post subject: Reply with quote

Hi Tdk161: Very Happy

Some time ago I wrote "PequeZip"; a little and basic application for ZIP files:

http://vds.uvedese.es/index.php?option=com_content&task=view&id=113&Itemid=5

I used "MTZip" library. This library needs "ZipDll.dll & UnZipdll.dll" librarys:

http://vds.uvedese.es/index.php?option=com_content&task=view&id=74&Itemid=100

Obviously, the documentation of "PequeZip" is "old" and refers to my first Web.

If you need any help do not hesitate to contact me

Greetings Hi

__________

uVeDeSe
__________
Back to top
View user's profile Send private message Visit poster's website
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Thu Mar 24, 2011 5:47 pm    Post subject: Reply with quote

Unfortunately I can not load the libraries because they are not compatible with Windows Vista Sad Mad No clue

I can't run "PequeZip" Confused
Back to top
View user's profile Send private message Visit poster's website
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Thu Mar 24, 2011 8:07 pm    Post subject: Reply with quote

Oops Rolling Eyes

It's my fault. Libraries are compatible. I don't know why not run in my computer (desktop). In my portable PC is fine. Exclamation Exclamation
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Thu Mar 24, 2011 9:02 pm    Post subject: Reply with quote

are you using old library files? download the latest versions and see if that works on your system.
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Sun Mar 27, 2011 12:24 am    Post subject: Reply with quote

Ok, guys Smile

Maybe I didn't explain well my trouble, sorry Embarassed
There is my script:
Code:


External sszip.dll

#Define command,sszip
#define function,sszip,Carica

%x =
%d =
%h = 0
%%mPath = ""


  DIALOG CREATE,Test Zip,-1,0,674,327,ONTOP
  DIALOG ADD,STYLE,STYLE1,Verdana,,B,,
  DIALOG ADD,BUTTON,Open,8,255,64,24,Open Zip
  DIALOG ADD,TABLE,TABLE1,34,8,315,245,dati[380],COLUMNSORT,DBLCLICK
  DIALOG ADD,TEXT,TEXT1,290,8,332,15,TEXT1,,STYLE1
  DIALOG ADD,BUTTON,Root,5,183,64,24,Root
#  DIALOG ADD,TABLE,TABLE2,39,330,320,243,Column 1[80]|Column 2[80]|Column 3[80]
  DIALOG SHOW
  %%Zip = c:\pippo.zip

 
 :Loop 
  If %%Zip
    Dialog Set,Text1,[%%mPath]
    List Clear,Table1 
 #   List Clear,Table2
    %c = @SSzip(LIST,%%Zip)
    List Append,Table1,@Carica(%c,%%mPath)
  End
  Wait Event
  %e = @Event()
  Goto %e

:RootBUTTON
%%mPath =
Goto Loop

:OpenButton
  %%Zi = @FileDlg("Zip|*.zip|",Apri)
  If %%Zi
    %%Zip = %%Zi
    %i = 0
  End
Goto Loop

:Table1DBLCLICK
#%p = @Substr(@Item(TaBLE1),1,@Pred(@Pos(\,@Item(TaBLE1))))
    %p = @SSZIP(FILEINFO,%%Zip,@SSZIP(FIND,%%Zip,@Item(TaBLE1),),p)
If %p
  %h  = @SSZIP(FIND,%%Zip,%p,)
  If 1
    %%mPath = %%mPath%p
  End
End
Goto Loop

:Close
Stop 

:Carica
List Clear,Table1
%z = @New(LIST,SORTED)
List Append,%z,%1
%%Rit =
%l =
%p =
%i =
Repeat
  %l = @Next(%z)
  If %l 
    %d = @SSZIP(FILEINFO,%%Zip,@SSZIP(FIND,%%Zip,%l,),a)
    %u = @SSZIP(FILEINFO,%%Zip,@SSZIP(FIND,%%Zip,%l,),p)
    If @Equal(%d,A,exact)
      If @Equal(%%mPath,%u)
        %%Rit = %%Rit@Name(%l).@Ext(%l)@Cr()
      End
    ElsIf @Equal(%d,D,EXACT)
      If @UnEqual(%%mPath,%u)
        %%Rit = %%Rit%u@Cr()
      End
    End
  End
Until @Not(%l)
List Close,%z
Exit %%Rit


work well but when i select a subfolder inside the opend zip, Not work, does not display the files and folders in the selected folder like in the root Stupid Stupid Stupid I don't understand why Crying
Now I hope I was clearer

Byez and thank
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun Mar 27, 2011 6:19 pm    Post subject: Reply with quote

I don't remember using any of the zip extensions, but I'm pretty sure that if there's a path with each of the files, then you need to sort these paths yourself when you read the zip file in your program and display only the top level files along with any subfolders you have, but do not display the files in the subfolders until you double click on them, then you get a list of the files in that subfolder and update your display with only those files.

Code:
myzipfile.zip
Contents of zip file:
readme.txt
install.exe
install files/file 1.dat
install files/file 2.dat
install files/file 3.dat
install files/file 4.dat
install files/file 5.dat


So, you have 2 files in the root and then 5 files in a subfolder. When you read the zip file only display the two root files and then a folder for the "install files" folder and stop there, do not display the files in that subfolder.

Code:
myzipfile.zip
Contents of zip file:
readme.txt
install.exe
[install files]


Now if you double click on the "install files" folder, you in your code will put a list of files together of what is in the "install files" folder, empty your display and now update the display with only the files from the "install folder". Of course add an entry for going back up to the root.

Now your display should show this:

Code:
myzipfile.zip
Contents of zip file:
[..]
file 1.dat
file 2.dat
file 3.dat
file 4.dat
file 5.dat


I hope you can understand what I mean by this. Good luck and have fun,
~Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Mon Mar 28, 2011 1:09 am    Post subject: Reply with quote

Hello Garrett, Smile
are aware of what you said to me, for you have confirmed my idea,
my problem is that I can not get it done on my script, they are several weeks that I'm trying to figure out how to do, but unfortunately so far without results

Thank you anyway
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Mar 28, 2011 7:19 pm    Post subject: Reply with quote

The concept is in fact quite simple, I can even see the code in my mind. You might be thinking in complicated terms. Erase what you are thinking and start over, but this time think in simple terms. It's all in the internal LIST. You read in the zip file into your internal list and you simply go through the list only display the root files and the folders in the root file at first. Double click on a folder in that list, you have the name of it now, so go through your internal list and look for the entries that have that folder, grab each entry for that folder, put them in a new internal LIST, now you simply clear your display and start filling it with your new list. You don't need to read the zip file again since you already have the entire contents of the list file in your first LIST. Also keep a variable with your current path within the zip file.

Other than writing this for you, I can't spell it out any easier than this. If you just look at this in simple terms I believe you will see it. It is less than a day's worth of coding too. Just clear your mind and think in simple terms.

~Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Fri Apr 01, 2011 2:58 pm    Post subject: Reply with quote

Garrett,
safe and simple, I deleted from my mind on my old idea but probably are too stubborn to be able to implement the ' idea that you kindly explained to me.... Result I can not even get the view I want, and I'm still breaking my head to be able to obtain
anyway thank you so much for the explanations you have given me

Cheers
Back to top
View user's profile Send private message Send e-mail
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Mon Apr 18, 2011 2:58 pm    Post subject: Reply with quote

Hi,
I have been trying unsuccessfully for a long time to get what I have already explained, but without any appreciable result, and I'm really mad.
there's really no one here who can kindly help me? Maybe posting a code sample?
I think it's the same procedure to display in a table the contents of a folder, more or less
Humbly await your help
Thanks
Back to top
View user's profile Send private message Send e-mail
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Mon Apr 18, 2011 4:49 pm    Post subject: Reply with quote

not relevant. See my new post below

Last edited by cnodnarb on Mon Apr 18, 2011 11:55 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Mon Apr 18, 2011 11:55 pm    Post subject: Reply with quote

Good thing I'm on spring break and I'd never tried this before.

To be honest, I would extract the zip to a temp folder and have the user open the dang thing in explorer, windows wizard style.

Here ya go. It's a little rough around the edges but your talented enough to smooth it out.

Code:
External sszip.dll

#Define command,sszip,array
#define function,sszip

  DIALOG CREATE,Test Zip,-1,0,674,327,ONTOP
  DIALOG ADD,STYLE,STYLE1,Verdana,,B,,
  DIALOG ADD,BUTTON,Open,8,255,64,24,Open Zip
  DIALOG ADD,TABLE,TABLE1,34,8,315,245,dati[380],COLUMNSORT,DBLCLICK
  DIALOG ADD,TEXT,TEXT1,290,8,332,15,TEXT1,,STYLE1
  DIALOG ADD,BUTTON,Root,5,183,64,24,Root
  dialog add,list,dirarray,0,0,0,0
  dialog add,list,fullist,0,0,0,0
  dialog add,list,level0,0,0,0,0
  dialog add,list,matchcheck,0,0,0,0
#  DIALOG ADD,TABLE,TABLE2,39,330,320,243,Column 1[80]|Column 2[80]|Column 3[80]
  DIALOG SHOW
  %%Zip = @path(%0)richedit.zip
:init
  %%l = 0
  %%maxlevel = 0
 
    %c = @SSzip(LIST,%%Zip)
   
   dialog set,fullist,%c
   
 
   
   %%operation = addtolevel

:level
if @null(@text(fullist))
goto evloop
end
 %%list = fullist
   list seek,%%list,0
repeat
gosub %%operation
list seek,%%list,@succ(@index(%%list))
until @equal(@index(%%list),@pred(@count(%%list)))
gosub %%operation

dialog set,table1,@text(level0)
   
   :evloop
   dialog set,text1,%%matchthis - %%l
   wait event
   goto @event()

   :close
   exit
   
:array
rem dialog add,list,%1,0,0,0,0
list clear,%1
repeat
parse "%3;%4",%2
%5 = @substr(%2,@sum(@len(%3),2),@len(%2))
if %3
list add,%1,%3
%2 = %5
end
until @null(%3)
exit

:addtolevel
option fieldsep,\
array dirarray,@item(%%list)

if @greater(@count(dirarray),%%maxlevel)
%%maxlevel = @count(dirarray)
end
list clear,matchcheck
if @equal(%%l,0)
list add,matchcheck,@item(dirarray,%%l)
%%matchthis = @item(dirarray,%%l)
end
list add,matchcheck,@item(dirarray,@pred(%%l))
if @match(matchcheck,%%matchthis)
if @not(@match(level0,@item(dirarray,%%l)))
if @not(@equal("",@item(dirarray,%%l)))
list add,level0,@item(dirarray,%%l)
end
end
end
exit

:table1dblclick
if @not(@equal(%%l,0))
if @equal(%%matchthis,@item(table1))
%%l = @diff(%%l,1)
list clear,level0
%%matchthis = %%lastmatchthis
goto level
end
end
%%lastmatchthis = %%matchthis
%%matchthis = @item(table1)
%%l = @succ(%%l)
list clear,level0
goto level

:rootbutton
%%lastmatchthis = ""
%%matchthis = ""
%%l = 0
list clear,level0
goto level

:openbutton
%%zip = @filedlg(*.zip)
if %%zip
list clear,level0
list clear,table1
%%lastmatchthis = ""
%%matchthis = ""
%%l = 0
goto init
else
goto evloop
Back to top
View user's profile Send private message AIM Address
Tdk161
Valued Contributor
Valued Contributor


Joined: 08 Feb 2005
Posts: 399
Location: ITALY

PostPosted: Sat Apr 23, 2011 8:45 pm    Post subject: Reply with quote

Hi cnodnarb Smile
thankyou very much for you sample, I'm tried it and work! Laughing

But there is in attach a sample zip file with folder, files, subfolders an subsubfolser and I'm modifing ypur script to seee with this Mad but at now without success

Thank you again



Test.zip
 Description:
Sample zip with more than one subfolder

Download
 Filename:  Test.zip
 Filesize:  1.42 KB
 Downloaded:  1275 Time(s)

Back to top
View user's profile Send private message Send e-mail
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Sun Apr 24, 2011 6:43 pm    Post subject: Reply with quote

Sorry TDK, I can't find the trouble.

The root of the subfolder is listed as the top item...is that the trouble?

That's there so they can double click it and go back down one level.

Once again, did not experience difficulty.

Can you be more explicit?

Thanks,

cnodnarb
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group