Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#203 Support for wildcard substitution in copy

open
nobody
None
5
2012-09-07
2007-09-04
Rafał Rzepecki
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

  • 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

     
  • testcopy.bat

     
    Attachments
  • 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