In article <·················@cadservices.nl>,
ckl <··········@cadservices.nl> wrote:
>I'm looking for a way to combine binary files into one file, but I see
>no way to does this.
>Can anyone help me.
What do you mean by this? Merging the files, appending one file to
another, something else?
If you just need to append them, something like this should work:
(defun concatenate-binary-files (file1 file2 output-file element-type)
(with-open-file (in1 file1
:direction :input :element-type element-type)
(with-open-file (in2 file2
:direction :input :element-type element-type)
(with-open-file (out output-file
:direction :output :element-type element-type)
(loop for byte = (read-byte in1 nil)
while byte
do (write-byte out byte))
(loop for byte = (read-byte in2 nil)
while byte
do (write-byte out byte))))))
Of course, it may be simpler to do this from the OS; if you're on Unix,
"cat file1 file2 > output-file" will do it.
--
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Cambridge, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
In article <···················@burlma1-snr1.gtei.net>,
Barry Margolin <······@bbnplanet.com> writes:
> In article <·················@cadservices.nl>,
> ckl <··········@cadservices.nl> wrote:
>>I'm looking for a way to combine binary files into one file, but I see
>>no way to does this.
>>Can anyone help me.
>
> What do you mean by this? Merging the files, appending one file to
> another, something else?
>
> Of course, it may be simpler to do this from the OS; if you're on Unix,
> "cat file1 file2 > output-file" will do it.
>
And of course, that may not give you a valid binary file for whatever uses
them. (Just thought I'd better state the obvious.)
Mike McDonald
·······@mikemac.com
In article <·······················@news.teleport.com>,
·······@mikemac.com wrote:
> In article <···················@burlma1-snr1.gtei.net>,
> Barry Margolin <······@bbnplanet.com> writes:
> > In article <·················@cadservices.nl>,
> > ckl <··········@cadservices.nl> wrote:
> >>I'm looking for a way to combine binary files into one file, but I see
> >>no way to does this.
> >>Can anyone help me.
> >
> > What do you mean by this? Merging the files, appending one file to
> > another, something else?
> >
>
> > Of course, it may be simpler to do this from the OS; if you're on Unix,
> > "cat file1 file2 > output-file" will do it.
> >
>
> And of course, that may not give you a valid binary file for whatever uses
> them. (Just thought I'd better state the obvious.)
>
> Mike McDonald
> ·······@mikemac.com
ACL can do it.
For MCL use the function FASL-CONCATENATE from
ccl:examples;fasl-concatenate.lisp .