• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

COPY ... TO: issue

#1
I recognize that I gave a bit of a silly syntax, but it did not behave well
at all, I believe.

I often copy files into the current folder with "copy file". I started to
type my copy command, thinking I was going to copy it multiple locations,
then decided against it. I ended up with "copy file to:" and no destination
specified. Unfortunately, it copied the file into my O: drive. Luckily, it
did not destroy any data there, but it seems like either copying to the
current folder (best) or throwing a syntax error is necessary. Using any
other two letter and colon (e.g. copy file ab:) gives what I believe to be
the proper error message, if an error message is thrown: "TCC: (Sys) The
filename, directory name, or volume label syntax is incorrect.".

I believe that copying into O: is a bug, and potentially a damaging one.

--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 

samintz

Scott Mintz
May 20, 2008
1,238
11
Solon, OH, USA
#3
Or do you have a directory alias defined?

-Scott

rconn <> wrote on 11/30/2010 01:16:57 PM:


> ---Quote (Originally by Jim Cook)---
>
> I believe that copying into O: is a bug, and potentially a damaging one.
> ---End Quote---
>
> Not reproducible here, and (from a quick pass through the code) not
> possible in the code unless you have additional arguments after the
"to:".

>
> Do you have an alias for COPY?
>
>
>
>
 
#4
I do not have directory aliases, but did have an alias for copy. Here are
the results of some tests. The copy should go into D:\TEST, I believe.

D:\test>*copy \foo to:
Usage : COPY [/A:[[-][+]rhsdaecjot] /CDEFGH /FTP:A /I"text" /JKLM /MD
/N[dejnst] /O:[-]adegnrstu /OPQR /Sn /TUVWXZ] source [+] ... [/A /B] [TO:]
destination [...] [/A /B]

D:\test>*copy \foo to: /g
D:\foo => D:\g
1 file copied

D:\test>*copy /g \foo to:
D:\foo => O:\foo
1 file copied

D:\test>*copy \foo to: /g
D:\foo => D:\g
1 file copied

D:\test>*copy \foo /g
D:\foo => D:\test\foo
1 file copied

D:\test>*copy \foo
D:\foo => D:\test\foo
1 file copied

D:\test>*copy /g \foo
D:\foo => D:\test\foo
1 file copied


On Tue, Nov 30, 2010 at 10:16, rconn <> wrote:


> ---Quote (Originally by Jim Cook)---
>
> I believe that copying into O: is a bug, and potentially a damaging one.
> ---End Quote---
>
> Not reproducible here, and (from a quick pass through the code) not
> possible in the code unless you have additional arguments after the "to:".
>
> Do you have an alias for COPY?
>
>
>
>
>


--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
#7
On Tue, Nov 30, 2010 at 14:09, rconn <> wrote:


> ---Quote (Originally by Jim Cook)---
> I do not have directory aliases, but did have an alias for copy. Here are
> the results of some tests. The copy should go into D:\TEST, I believe.
> ---End Quote---
>
> No -- the COPY syntax requires that only target names follow a "to:". COPY
> does not try to parse out misplaced command switches.
>
I believe I follow that rule with the following, which fails and copies to
O: instead of the current folder (D:\TEST). I will concede that copy foo to:
/g is illegal.

D:\test>*copy /g \foo to:
D:\foo => O:\foo
1 file copied


--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
Top Bottom