DOS_COPY question

Discussion in 'AutoCAD' started by The real JD, Jan 19, 2004.

  1. The real JD

    The real JD Guest

    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?
     
    The real JD, Jan 19, 2004
    #1
  2. to me looks like is not the same dos function it works to files into another
    drive or path

    --
    Get your free DRAFTTEAM version 1.4 cop(ies)!,
    How? download it from here: http://www.draftteam.com/draftteam/draftteam.zip
    Or sent your request to:

    [A comprehensive set of drafting routines to enhance and supplement the use
    of AutoCAD.]

    Offer ends on Friday, January 23 of 2004
     
    Luis Esquivel, Jan 19, 2004
    #2
  3. The real JD

    The real JD Guest

    Is there a way to do this thru lisp?

     
    The real JD, Jan 19, 2004
    #3
  4. The real JD

    Mark Propst Guest

    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


     
    Mark Propst, Jan 19, 2004
    #4
  5. The real JD

    The real JD Guest

    Sorry for my ignorance, but how do i get all the text files from a directory
    to be the "list" ?

     
    The real JD, Jan 19, 2004
    #5
  6. The real JD

    Mark Propst Guest

    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
    )
     
    Mark Propst, Jan 20, 2004
    #6
  7. The real JD

    kozmos Guest

    you can do this via VLISP by calling WSH (Windows Script Hosting) activeX functions
     
    kozmos, Jan 20, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.