Архиватор v1.2(ru/ang)

Post Reply
User avatar
MARK99
Posts: 295
Joined: Tue Feb 03, 2015 2:33 pm
My devices: Ipad 4 , iphone 5
Flag: Russia
Contact:

Архиватор v1.2(ru/ang)

Post by MARK99 » Wed Mar 30, 2016 7:34 pm

При передачи и хранение файлов большого объема требуется моного времени для скачивания, памяти для хранения, поэтому предлагаю такой вот утилит: Архиватор v1.
Выберите нужную папку, адрес которой должен быть указан в верхнем окне и нажмите "компрессировать" для сжатия папки, или "распаковать" для разархивирования, также в папке создаётся файл "GUNZIP", который поможет вашим друзьям, если они не скачали этот утилит, разархивировать папку)))

When the transmission and storage of large files is required monogo time to download, storage space, so I suggest such a utilities: Takeout v1.
Select the desired folder, whose address should be listed in the top box and click "compress" to compress the folder, or "unzip" to unpack, and in the folder created "gunzip" file, which will help your friends if they have not downloaded this utility, unzip folder)))

Code: Select all

/*
Архиватор v1.2
Archiver v1.2
by MARK99
*/
IF SYSTEM_LANGUAGE$ ()="ru" THEN
  gunz1$="распаковать"
  gz1$="компрессировать"
ELSE
  gunz1$="unzip"
  gz1$="compress"
ENDIF

a1=SCREEN_WIDTH() 'ширина экрана/screen width
a2=SCREEN_HEIGHT() 'высота экрана/screen height
OPTION BASE 1

BUTTON "gunz" TEXT gunz1$ AT a1-(a1-a2)/3*2,0 SIZE (a1-a2)/3*2,44 ' кнопка распаковки ф./unpacking button f.
BUTTON "gz" TEXT gz1$ AT a1-(a1-a2)/3*2,44 SIZE (a1-a2)/3*2,44 'кнопка компрессии ф./Compression button f.
DIR "/" LIST DIRS A$, B
FIELD "pole" TEXT "/"&A$(1) AT 0,0 SIZE a2,44' поле ввода/entry field
LIST "spisok" TEXT A$ AT 0,50 SIZE a2,a2-50' лист с папками/folders list
locl$="" 'адрес файла/address file
adres$="" 'конечный адрес/final address
1
IF LIST_SELECTED ("spisok")>0 THEN
  locl$=locl$&"/"&a$(LIST_SELECTED ("spisok")) 'присваения адреса/address assignment
  LIST "spisok" SELECT -1
  DIR locl$ LIST DIRS A$, B 
  LIST "spisok" TEXT A$ AT 0,50 SIZE a2,a2-50' лист с папками/folders list
  FIELD "pole" TEXT locl$ AT 0,0 SIZE a2,44' поле ввода/entry field
ENDIF
IF BUTTON_PRESSED ("gunz")=1 THEN' распаковка/unzip
  adres$=FIELD_TEXT$ ("pole")
  adres1$=adreS$
  zip=0
  GOTO LOOP
ENDIF
IF BUTTON_PRESSED ("gz")=1 THEN'сжатие/compress
  adres$=FIELD_TEXT$ ("pole")
  adres1$=adreS$  
  zip=1
  FILE adres$&"/GUNZIP" PRINT
  GOTO LOOP
ENDIF
GOTO 1

LOOP:
DIR adres1$ LIST DIRS papK$, papki 'папки/folders
DIR adres1$ LIST FILES fil$, FILL 'файлы/files
IF FILL>0 THEN
  FOR k=1 TO FILL
    IF zip=1 THEN
      IF (INSTR (fil$(k), ".zip")<0) AND (INSTR (fil$(k), ".")>0) THEN 'сжатие или распаковка файлов/compression and decompression of files
        pastfil$=adres1$&"/"&fil$(k)
        newfil$=adres1$&"/"&fil$(k)&".zip"
        GZIP pastfil$ TO newfil$
        FILE adres1$&"/"&fil$(k) DELETE
        pastfil1$=MID$ (pastfil$,LEN (adres$)+2,LEN (pastfil$))
        newfil1$=MID$ (newfil$,LEN (adres$)+2,LEN (newfil$))
        FILE adres$&"/GUNZIP" WRITELINE "GUNZIP "&""""&newfil1$&""""&" TO "&""""&pastfil1$&""""
        FILE adres$&"/GUNZIP" WRITELINE "FILE "&""""&newfil1$&""""&" DELETE"
      ENDIF
    ENDIF
    IF zip=0 THEN
      IF INSTR (fil$(k), ".zip")>0 THEN 
        pastfil$=adres1$&"/"&fil$(k)
        newfil$=adres1$&"/"&(MID$ (fil$(k), 1, INSTR (fil$(k), ".zip")-1))
        GUNZIP pastfil$ TO newfil$
        FILE adres1$&"/"&fil$(k) DELETE
      ENDIF
    ENDIF
  NEXT k
ENDIF
              
IF papki>0 THEN'обход по файлу/bypassing the file
  IF pastadres$<>"" THEN
    FOR k=1 TO papki-1                  
      IF pastadres$=papk$(k) THEN l=k+1
    NEXT k
    IF pastadres$=papk$(papki) THEN GOTO 2
    IF l>papki THEN GOTO 2
  ELSE
    l=1
  ENDIF
  IF papki=1 THEN l=1
  
  adres1$=adres1$&"/"&papk$(l)
ELSE
  2
  IF adres1$=adreS$ THEN
    END
  ELSE
    pastadres$=REVERSE$ (MID$ (REVERSE$ (adres1$),1,INSTR(REVERSE$ (adres1$),"/")-1))
    adres1$=MID$ (adres1$,1, INSTR (adres1$,pastadres$)-2)
  ENDIF
ENDIF
GOTO LOOP               

Attachments
image.png
image.png (81.44 KiB) Viewed 4247 times
Image

User avatar
MARK99
Posts: 295
Joined: Tue Feb 03, 2015 2:33 pm
My devices: Ipad 4 , iphone 5
Flag: Russia
Contact:

Re: Архиватор v1.2(ru/ang)

Post by MARK99 » Thu Jun 16, 2016 9:47 pm

Archiver v1.2
Added English!!!
Image

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Архиватор v1.2(ru/ang)

Post by rbytes » Fri Jun 17, 2016 11:41 am

I have your zip/unzip program installed. Is there a zipped System Attendant file that I have to unzip?
Zzzzz

User avatar
MARK99
Posts: 295
Joined: Tue Feb 03, 2015 2:33 pm
My devices: Ipad 4 , iphone 5
Flag: Russia
Contact:

Re: Архиватор v1.2(ru/ang)

Post by MARK99 » Fri Jun 17, 2016 3:24 pm

ricardobytes wrote:I have your zip/unzip program installed. Is there a zipped System Attendant file that I have to unzip?
you must run the file "GUNZIP" and he decompresses the entire file "System Attendant", but if the file "GUNZIP" does not exist then use this app: Simply select the folder name and click "unzip".
Attachments
image.png
image.png (2.59 MiB) Viewed 2319 times
image.png
image.png (77.41 KiB) Viewed 2319 times
Image

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Архиватор v1.2(ru/ang)

Post by rbytes » Fri Jun 17, 2016 3:57 pm

The System Attendant folder that I have on my iPad is not zipped. It contains the program System Attendant sB.cod and a folder called system which contains several .txt files and some more folders.

So is there a link I have to go to download the zipped System Attendant folder?
Zzzzz

User avatar
MARK99
Posts: 295
Joined: Tue Feb 03, 2015 2:33 pm
My devices: Ipad 4 , iphone 5
Flag: Russia
Contact:

Re: Архиватор v1.2(ru/ang)

Post by MARK99 » Fri Jun 17, 2016 5:06 pm

ricardobytes wrote:The System Attendant folder that I have on my iPad is not zipped. It contains the program System Attendant sB.cod and a folder called system which contains several .txt files and some more folders.

So is there a link I have to go to download the zipped System Attendant folder?
I copied the file yesterday, there is now every archived file;

Yes)
Image

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Архиватор v1.2(ru/ang)

Post by rbytes » Sun Jun 19, 2016 2:21 am

Thanks. I have made some revisions to the code of System Attendant:

- Translated all Russian interface objects into English
- Translated some of the comments - some words were not recognized by my translator app and I will message those to you to get their meanings.
- Made font smaller on the file icons and now allow 20 rather than 12 characters (some names were so shortened I couldn't recognize them.)
- Surrounded white letters with black edges to make them readable on light-colored images in the file icons

How do you want me to handle the naming, version numbering and posting? Can I post the English version in the English section of the forum? You will still show as the author in the header and comments. I would add a little credit for me in the comments as the translator if that is OK. If you agree, I might name it System Attendant En, unless you would rather keep just one program thread.

Also something else to consider. I have changed all of my smartBASIC programs to end in .sb instead of .txt It distinguishes them from regular text files, and I don't have to rename them before I can copy them from Dropbox. I recommend this to you. I would like to have System Attendant treat them as smartBASIC programs, but haven't yet figured out where in the code I can do that. I found out where you assign icon types, and got SA to use the same icons for .sb as it does for .txt files. But when I click on the .sb icons, they don't open the program editor.
Zzzzz

User avatar
MARK99
Posts: 295
Joined: Tue Feb 03, 2015 2:33 pm
My devices: Ipad 4 , iphone 5
Flag: Russia
Contact:

Re: Архиватор v1.2(ru/ang)

Post by MARK99 » Mon Jun 20, 2016 11:01 am

ricardobytes wrote:Thanks. I have made some revisions to the code of System Attendant:

- Translated all Russian interface objects into English
- Translated some of the comments - some words were not recognized by my translator app and I will message those to you to get their meanings.
- Made font smaller on the file icons and now allow 20 rather than 12 characters (some names were so shortened I couldn't recognize them.)
- Surrounded white letters with black edges to make them readable on light-colored images in the file icons

How do you want me to handle the naming, version numbering and posting? Can I post the English version in the English section of the forum? You will still show as the author in the header and comments. I would add a little credit for me in the comments as the translator if that is OK. If you agree, I might name it System Attendant En, unless you would rather keep just one program thread.

Also something else to consider. I have changed all of my smartBASIC programs to end in .sb instead of .txt It distinguishes them from regular text files, and I don't have to rename them before I can copy them from Dropbox. I recommend this to you. I would like to have System Attendant treat them as smartBASIC programs, but haven't yet figured out where in the code I can do that. I found out where you assign icon types, and got SA to use the same icons for .sb as it does for .txt files. But when I click on the .sb icons, they don't open the program editor.
Can you please write about on page Sys System attendant? ..
I'll post the answer there.
Image

Post Reply