XXCOPY

DATMAN TECHNICAL BULLETIN #018



From:    tech@datman.com
To:      DATMAN user
Subject: The filename length
Date:    1996-12-04
====================================================================

A number of DATMAN users have reported difficulties in copying either
an entire hard disk or a file server volume to a DATMAN tape.  The
common symptom is that they do not see all the files or directories
on the destination.  For example, you find 800 directories on the
source volume and DATMAN reports only 500 on the destination after
the copy.

Where did the directories and files go?

If you are adding an additional level of subdirectory to represent
the backup session on the target volume, be sure to check the worst
case filename length.  The longest filename string including the
drive letter and colon is 79 characters (many programmers remember
the magic number to be 80 which includes the terminating "nul"
character at the end).

Another limit many users overlook is the 64-character limit on the
pathname.  In this context, the 64-character limit starts with the
first backslash which represents the root directory.  If you add
the common volume specifier (a drive letter plus a colon), the
maximum length for the pathname will be 66.   Now, the longest name
(the "lastname") in the so-called 8.3 DOS naming convention is 12
characters.  Therefore, the total is

   66 + 1 + 12 = 79

The "+ 1" in the middle is for the last backslash.  Adding the
terminating nul character at the end will make up the magic number
of 80 bytes which most people remember.

The better way to remember the limits is to remember that the
longest subdirectory name allowed in DOS is 66 characters.  The
80-character limit commonly sited should be only for programmers
who need to allocate a buffer of 80 bytes.  If you remember the
66-character limit, then the 79 character limit can be derived.

The mysterious "bug" by DCOPY is typically created by the following
command line...

  dcopy f:\  t:\drive_f  /i/s/c

In this example, the /i switch makes the new directory without
confirmation (DRIVE_F consumes additional 8 characters). The /s
switch handles subdirectories recursively.  The common /c switch
which is typically needed to suppress the file-sharing violation
error also lets you continue after the file-length error condition is
encountered.  So, it is DOS which refuses to create the directories
whose name is too long.  As a result, all the files under the
failed subdirectories will evaporate.

We recommend that you keep the worst case subdirectory name to be
with 57 characters which will have a room for one more backslash
and 8-letter directory name.

If you suspect your file server (or your hard disk) may contain
near-the-limit subdirectory names, do not add any more layer of
subdirectory when you copy it to DATMAN tape.  The following method
creates a backup volume which avoids the possible filename length
problems altogether.

  dcopy f:\  t:\  /s/c


Well, if you use Windows 95 (and when we support the new OS), this
seems a moot point.  However, if you are not careful and indulge
in making unnecessarily long names, you will be eventually bitten
again.  We advise that you stay within 24 characters for directory
names and 32 characters on the "lastname".  This will only give you
about 8 levels in directory tree.  In the good old DOS world, with
most directory names within 8 characters, you always had 7 levels.

After all, most computer resources seem infinite at first and become
so small as they age.  The filename length is no exception.

[ More Technical Bulletins ] [ DATMAN Table of Contents ]