RES: Re: Divide a file
[1/2] from: castellani-cpt::itautec-philco::com::br at: 10-Dec-2003 13:30
Some doubts...
It's run under rebol/core ?
I'll distribute this script to a client. How he can do to run it without
open rebol, just with a command line ?
Marcelo, just a begginer...
-----Mensagem original-----
De: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]]Em nome de Al
TS
Enviada em: quarta-feira, 10 de dezembro de 2003 11:29
Para: [rebol-list--rebol--com]
Assunto: [REBOL] Re: Divide a file
Please find this little part of code :
REBOL []
fsplit: get in context
[ fsplit: func
[ {split the file in files with names root-name1 root-name2 ...
of block-size length.
}
file
root-name
block-size
/local
source-file data destination-file file-count file-name
]
[ file-count: 0
source-file: open/read/binary/direct/no-wait file
while [data: copy/part source-file block-size]
[ file-count: file-count + 1
file-name: rejoin [to-file root-name file-count]
destination-file: open/write/binary/direct file-name
insert destination-file data
close destination-file
]
close source-file
]
] 'fsplit
; fsplit c:\winzip.log "winziplog" 16384
; split winzip.log file in files winziplog1 winziplog2 ... of 16Kb length
Hope this help !
-yos
Marcelo Fontes Castellani <[castellani-cpt--itautec-philco--com--br]> wrote:
Hi guys
I need to upload an file to my FTP site but I need to divide this file in
multiple files. For example, if file have 2048 KB I need to divide it in 2
(1024 and 1024).
I can do it with Rebol, ok ? If I can, how can I do ?...
Thanks and a hug...
[2/2] from: carlos:lorenz:bol at: 10-Dec-2003 15:13
Marcelo
I guess once your client has REBOL/Core he/she can invoke it
passing your script as an argument in command line.
Just create a batch file to do it
Carlos Lorenz
Em Qua 10 Dez 2003 14:30, Marcelo Fontes Castellani escreveu: