Patch for COPYing directories

Here you can discuss the development of patches.

Patch for COPYing directories

Postby ripsaw8080 » 2009-6-07 @ 12:52

DOSBox's internal COPY command does not support copying all files from a source directory unless \*.* is explicitly appended to the filespec. Real DOS assumes *.* when the source filespec is a directory, and game install batch files might use this (Bram Stoker's Dracula is one I know of that does). You can, of course, work around the limitation by editing batch files, manually copying files, using the 4DOS shell, etc; but I thought it would be nice to have the feature.

It's a simple idea, but was a bit tricky to splice into the code without breaking existing functionality. All the most obvious stuff works OK as far as I can tell, including the source concatenations which gave me some trouble. Note that DOSBox supports concatenation with the "+" sign, but not with wildcards (as DOS does), and I didn't try to implement it... it's a good chance no game needs that, though. One quirky thing I ran into was DOS_FindFirst() reporting DOS_ATTR_DIRECTORY when the filespec has *.* in it, so I had to check if it's already there to avoid adding it again.

I'm sure the code could be improved, but I took the approach of trying not to change too much.
You do not have the required permissions to view the files attached to this post.
User avatar
DOSBox Author
Posts: 4296
Joined: 2006-4-25 @ 23:24

Return to DOSBox Patches

Who is online

Users browsing this forum: Delfino Furioso and 1 guest