ADSM-L

Re: Restore Truncated files

1999-10-20 13:31:10
Subject: Re: Restore Truncated files
From: Andy Raibeck <storman AT US.IBM DOT COM>
Date: Wed, 20 Oct 1999 10:31:10 -0700
Hi John,

I think you are talking about APAR IC23640. The scenario is
this: suppose you have two files, say, 123456~1.txt and
12345678910.txt. The first file is explicitly named with the
'~' character in it, while NT implicitly generates a short
name for the second file called 123456~2.txt.

If you try to restore these files to an empty directory and
ADSM happens to restore 12345678910.txt first, NT will
implicitly generate a short name of 123456~1.txt. Then when
ADSM tries to restore the file 123456~1.txt, you get a
message that the file already exists.

Unfortunately there isn't anything we can do about this since
the problem exists as a side-effect of Microsoft's decision to
incorporate an 8.3 naming scheme for backward-compatibility
with DOS and Windows 3.1x programs.

The operating system is responsible for assigning the 8.3 names.
There is no Win32 API call that allows me to say, "Create file
abcdefghij1.txt with short name ABCDEF~2.TXT". I can only say
"Create file abcdefghij.txt". The operating system handles the
creation of the short name. Even as an end user, there are no
operating system commands that allow you to specify the short
name. For example, you can not say
"copy abcdefghij1.txt abcdefghij2.txt /shortname=ABCDEF~5.TXT".

Even the operating system occasionally has problems like this.
For example, try this scenario:

1. Create a directory called C:\Dir1
2. In C:\Dir1, create two files called abcdef~1.txt and
   abcdefghij1.txt. abcdefghij1.txt will have a short name of
   ABCDEF~2.TXT.
3. Now create a directory called C:\Dir2
4. "cd" into C:\Dir1, then issue this command:
           move * \Dir2

You will get an error message that says:

   Cannot create a file when that file already exists.
   1 file(s) moved.

If you look in C:\Dir1, you will see that abcdef~1.txt is still
there. If you look in C:\Dir2, you will see abcdefghij1.txt it
now has a short name of ABCDEF~1.TXT. This is the first file
that move tried to process. The second file it tried to process
was abcdef~1.txt. At that time, it saw abcdefghij1.txt in
C:\Dir2 with short name ABCDEF~1.TXT, and the move failed.

The problem is worse if instead of issuing move, you issue copy.
The command will say "2 file(s) copied." But if you look in
C:\Dir2, you will see only one file: abcdefghij1.txt. The copy
command copied abcdefghij1.txt first, then copied abcdef~1.txt
over abcdefghij1.txt.

So ADSM is not the only product to have the problem. Even the
operating system itself can have conflicts between long and
short names. And the problem grows if you have multiple files
that are similarly named, such as abcdef~3.txt, abcdef~5.txt,
abcdefghij2.txt, abcdefghij3.txt, etc.

The APAR documents several possible work-arounds:

1) Restore the real short file name to a different location.
2) Change the long file name, then retry the operation.
3) Turn off short file name support on NT (may not be
   feasible for all users).
4) Avoid the problem altogether by not using 8.3 names that
   have '~' in the 7th position of the file name.

Regards,

Andy

Andy Raibeck
IBM Storage Systems Division
ADSM Client Development
e-mail: storman AT us.ibm DOT com
"The only dumb question is the one that goes unasked."

Has anyone seen this situation:
2 files in the same directory 1 file is 8.3 format the other is long file
name.
ex..  12345678.bat  12345678910.bat
when trying to restore the long file name it gets truncated and renamed with
a ~ sign.

This is a problem if the directory already has a file named the same with a
~ sign.

Thanks for the input.

John Stephens
Storage Solutions Specialists, Inc.
Tivoli Certified Consultant - ADSM V3
IBM Certified Specialist - AIX
Stephens AT Storsol DOT com
WWW.Storsol.com
Wk: 813-265-3707
Fax: 520-441-9829
Cell: 813.505.2526
He is no fool who gives what he cannot keep, to gain what he cannot lose.
<Prev in Thread] Current Thread [Next in Thread>