DOS_COPY question

The Real JD

Usenet Archive
Joined
Jul 28, 2003
Messages
183
Reaction score
0
using regular copy command in DOS you can copy multiple files into one file.
IE:
copy *.txt results.txt

Can't seem to do the same with DOSLIB's dos_copy function, even though the help file mentions:
(dos_copy source destination)
Parameters
source
The source file or files. source can contain wildcard characters ("*" and "?").

destination
The destination path or file.

With destination file being the keyword. Can you do this with dos_copy?
 
to me looks like is not the same dos function it works to files into another drive or path
 
Is there a way to do this thru lisp?

Luis Esquivel said:
to me looks like is not the same dos function it works to files into another drive or path

The real JD said:
using regular copy command in DOS you can copy multiple files into one file.
IE:
copy *.txt results.txt

Can't seem to do the same with DOSLIB's dos_copy function, even though the help file mentions:
(dos_copy source destination)
Parameters
source
The source file or files. source can contain wildcard characters ("*" and "?").

destination
The destination path or file.

With destination file being the keyword. Can you do this with dos_copy?
 
probably not what you're looking for but one way...
(setq flist(list sourcefilename1 sourcefilename2 sourcefilename3)) (mapcar (function (lambda(sourceFileName) (setq filesource(open sourceFileName "r")) (setq fileDest(open "destinationFileName" "a")) (while (setq lin1(read-line filesouce)) (if lin1 (write-line fileDest lin1) ) );while (close fileDest) (close filesource) );l );f flist );map )
or something like that

The real JD said:
Is there a way to do this thru lisp?

Luis Esquivel said:
to me looks like is not the same dos function it works to files into another drive or path

The real JD said:
using regular copy command in DOS you can copy multiple files into one file.
IE:
copy *.txt results.txt

Can't seem to do the same with DOSLIB's dos_copy function, even though the help file mentions:
(dos_copy source destination)
Parameters
source
The source file or files. source can contain wildcard characters ("*" and "?").

destination
The destination path or file.

With destination file being the keyword. Can you do this with dos_copy?
 
Sorry for my ignorance, but how do i get all the text files from a directory to be the "list" ?

Mark Propst said:
probably not what you're looking for but one way...
(setq flist(list sourcefilename1 sourcefilename2 sourcefilename3)) (mapcar (function (lambda(sourceFileName) (setq filesource(open sourceFileName "r")) (setq fileDest(open "destinationFileName" "a")) (while (setq lin1(read-line filesouce)) (if lin1 (write-line fileDest lin1) ) );while (close fileDest) (close filesource) );l );f flist );map )
or something like that

The real JD said:
Is there a way to do this thru lisp?

Luis Esquivel said:
to me looks like is not the same dos function it works to files into another drive or path
the
use
of AutoCAD.]

Offer ends on Friday, January 23 of 2004

using regular copy command in DOS you can copy multiple files into one file.
IE:
copy *.txt results.txt

Can't seem to do the same with DOSLIB's dos_copy function, even
though
the
help file mentions:
(dos_copy source destination)
Parameters
source
The source file or files. source can contain wildcard
characters
("*"
and "?").

destination
The destination path or file.

With destination file being the keyword. Can you do this with dos_copy?
 
I'm sure others here have better ways, but this is what I use. ;;; 2-20-03 ;;; adcf-GetFileList ;;; Args ;;; (1) Dir - [string] - directory to search ;;; (2) wc - [string] - wild card name to match ;;; Return:
;;; list of matching names
;;; example usage: (setq flist(adcf-GetFileList "C:\\textfiles" "*.txt")) (defun adcf-GetFileList (adcv:Dir adcv:wc / adcv:match adcv:flist) (setq adcv:flist niL) (or (setq adcv:match adcv:wc) (setq adcv:match "*.*") ) (setq adcv:flist (acad_strlsort (mapcar (function (lambda (fil) (strcase fil) ) ) (vl-directory-files adcv:Dir adcv:match 1);files only ) );sort );setq adcv:flist )
 
you can do this via VLISP by calling WSH (Windows Script Hosting) activeX functions
 

Latest threads

Back
Top