Menu

#203 Support for wildcard substitution in copy

open
nobody
None
5
2012-09-07
2007-09-04
No

One of the less-known but often used in batch files features of COPY is the ability to substitute names and extensions.

This allows us to do

copy .bat .bak
to make a backup of all batch files, or
copy database. dbcopy.
to make a copy of all the database files.

Alas, dosbox doesn't implement this feature and this breaks some scripts. Attached patch implements it cleanly and solves the problem.

(It is against the 0.72, but I hope it isn't much of a problem.)

Discussion

  • Rafał Rzepecki

    Rafał Rzepecki - 2007-09-04

    Logged In: YES
    user_id=534153
    Originator: YES

    One extra feature: allows for parts of filename substitution, such as

    copy image_.jpg backup_.bak

    This allows copy to be used in place of xcopy in many scripts.
    File Added: dosbox-0.72-copy-subst-better.diff

     
  • Rafał Rzepecki

    Rafał Rzepecki - 2007-09-04

    dosbox-0.72-copy-subst-better.diff

     
  • Rafał Rzepecki

    Rafał Rzepecki - 2007-09-04

    testcopy.bat

     
  • Rafał Rzepecki

    Rafał Rzepecki - 2007-09-04

    Logged In: YES
    user_id=534153
    Originator: YES

    Also attaching a test script.
    (Coverage not measured, but I hope it covers all the cases.)
    File Added: testcopy.bat

     

Log in to post a comment.