delorie.com/archives/browse.cgi   search  
Mail Archives: opendos/1997/04/22/15:37:24

Message-Id: <3.0.1.16.19970422152422.366f68ea@pop.verisim.com>
Date: Tue, 22 Apr 1997 15:24:22 -0400
To: opendos AT delorie DOT com
From: Takashi Toyooka <ttoyooka AT verisim DOT com>
Subject: Re: surprising xcopy behavior
In-Reply-To: <199704221755.TAA01628@magigimmix.xs4all.nl>
Mime-Version: 1.0

At 19:50 1997/04/22 +0200, yeep wrote:
>> I was interested in having opendos do an xcopy from
>> a floppy to a hard drive and have opendos recreate a
>> directory structure on the hard drive which already
>> exists on the floppy.
>> I tried:
>> xcopy /d /s a:\dirname\*.* c: <cr>
>
>You put "C:" in the command line, so XCOPY uses the CWD
>from harddisk C, which at the time would be the root dir.
>Then he copied the files from "dirname" to the CWD in C
>(again the root dir) and then copy the dir structure from
>"dirname".  Meaning only sub-dirs in "dirname".  This
>seems like normal behaviour to me.

I'm not sure it's the behaviour of "C:" defaulting to the CWD, so
much as the "\*.*" on the parameter before it.

I'm not certain, but try this:

xcopy /d /s a:\dirname c:\

This may not work.  I don't usually use xcopy.  If you have the
djgpp fileutils, you can do:

cp -R a:/dirname c:/

This will do what you want.

BTW, if the OpenDOS xcopy is like the MS-DOS one, then you probab-
ly want /e instead of /s.  That will also copy empty directories,
whereas /s will ignore them (silly behaviour, IMO).

----------------------------------------------------------------------
Takashi Toyooka <ttoyooka AT pobox DOT com>                     Verisim, Inc.
http://www.magi.com/~ttoyooka/                 http://www.verisim.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019