info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [mtools] Mtools 3.98, difference between -D A and -D a on mcopy


From: Alain Knaff
Subject: Re: [mtools] Mtools 3.98, difference between -D A and -D a on mcopy
Date: Sat, 24 May 2003 20:56:40 +0200
User-agent: KMail/1.5.1

On Wednesday 21 May 2003 22:51, Keith Christian wrote:
> I am interested in automatically renaming files when copying from Linux to
> drive A:, and was trying to determine the difference between the -DA and
> the -Da option.
>
> I was under the impression from the documentation (info mtools) that -Da
> would ask for confirmation on a file-by-file basis when copying more than
> one file from Linux to drive A:.

If you _don't_ specify any -D option on the command line, you will be
interactively prompted for an action to take. If, in that situation
(and that situation only), you type a lower case letter, it only
applies to the file you were prompted for. If you type an upper case
letter, it applies to all files from that point on.


If on the other hand, you do specify a -D option on the command line,
it always applies to all files. In this context the difference between
upper and lower case has something to do with long (primary) and short
(secondary) names.

In the pre-Windows 95 old days, the filenames for DOS were limited to
8 characters plus 3 for the extension. Since Windows95 no such
limitation exists, but an "equivalent" short name is still stored on
disk. The original name is called the "primary" name, the derived
short name is called the "secundary" name.

It may now happen that two files whose primary (long) name is
different share a same secundary (short) name. Upper case clash
options determine what happens in that case. Default behaviour is -DA
(autorename the short name).

However, you may chose a different behaviour:

> mcopy /etc/issue t:longlong1.txt
> mdir t:
 Volume in drive T has no label
 Volume Serial Number is 4E85-BE8A
Directory for T:/

LONGLO~1 TXT        54 2003-05-24  20:39  longlong1.txt
        1 file                   54 bytes
                          1 457 152 bytes free

> mcopy -DO /etc/passwd t:longlong2.txt
> mdir t:
 Volume in drive T has no label
 Volume Serial Number is 4E85-BE8A
Directory for T:/

LONGLO~1 TXT      3653 2003-05-24  20:40  longlong2.txt
        1 file                3 653 bytes
                          1 453 568 bytes free


In this example, I specify "overwrite" for secundary name clashes,
hence the longlong2.txt file overwrites the longlong1.txt file
(although the primary (long) name is different, the secundary
(shortened) name is the same). The default behaviour would have been
-DA, i.e. autorename:

> mcopy  /etc/passwd t:longlong3.txt
> mdir t:
 Volume in drive T has no label
 Volume Serial Number is 4E85-BE8A
Directory for T:/

LONGLO~1 TXT      3653 2003-05-24  20:40  longlong2.txt
LONGLO~2 TXT      3653 2003-05-24  20:41  longlong3.txt
        2 files               7 306 bytes
                          1 449 472 bytes free

Rather than overwriting the original LONGLO~1.TXT file, mtools choses
to call the new file LONGLO~2.TXT instead (autorename).


The lower case option applies to the long name. Default is "prompt the
user" (i.e. -Dm).


Here is what the doc says about -Da vs -DA:

`-D a'
     Autorenames primary name by default.

`-D A'
     Autorenames secondary name by default.

> However, it seems that -Da works for both single filenames and a wildcard
> filespec (shown below.)

It has nothing to do with wildcards or single filenames. It's short
name (pre-Win95) vs long name (post-Win95).

> Is this correct, or is this item addressed in an updated to Mtools higher
> than revision 3.98, which is what I am running (on a "stock" Red Hat 8.0
> system.)

The current behaviour is already quite old and predated 3.9.8. If I
remember correctly, it was that way since the time when mtools first
supported Win95-style long names.

>
>
> # First, copy five test files to the floppy
>     address@hidden copytest]# mcopy -mpsvDA * a:
>     Copying 11
>     Copying 12
>     Copying 13
>     Copying 14
>     Copying 15
>
> # Next, copy them again, see if user intervention is needed (Press A or a)
> # (Want a command line argument so that user intervention is not required.)
>     address@hidden copytest]# mcopy -mpsvDA * a:
>     Long file name "11" already exists.
>     a)utorename A)utorename-all r)ename R)ename-all o)verwrite
> O)verwrite-all s)kip S)kip-all q)uit (aArRoOsSq): q

You have clashes in the primary (long) name, which is still 'm' by
default.
Your -DA merely asserted the default behaviour for the shortened
names.

Ok, so your example adds another twist: your names are short enough to
begin with, in this situation the original name (11, 12, ...) is at
the same time primary and secundary name. The mtools prompt asks you
about the primary name aspect of the clash.

> # Above, -DA didn't trigger automatic renaming, try -Da
> # Yes, it works!!
>     address@hidden copytest]# mcopy -mpsvDa * a:
>     Copying 11-1
>     Copying 12-1
>     Copying 13-1
>     Copying 14-1
>     Copying 15-1

In this case, you instruct mtools to rename the primary (original)
name, so you get 11 => 11-1 , 12 => 12-1, ...

Regards,

Alain


_______________________________________________
mtools mailing list
address@hidden
http://www.tux.org/mailman/listinfo/mtools


reply via email to

[Prev in Thread] Current Thread [Next in Thread]