sgp wrote:
> I couldn't find a PP native way to convert a
> long filename to its short 8.3 FAT filename
> equivalent. Perhaps this function should be
> added to the file plugin.

A caution: converting a long filename to its short
8.3 filename is not trivial.

The solution is not a matter of "converting"
(by Regular Expression routines for example)
but rather a matter of *reading* the short name
from the directory.

Try this experiment:
Create two directories, c:\test1 and c:\test2.
In \test1\, make two files with long names and with
different sizes to identify them: longnamea.txt
and longnameb.txt.

In a dos box, aka cmd.exe / command.com window,
do: dir /x ;; which shows both the long and short names.
You will see the first file created (say longnamea.txt)
has a short name of LONGNA~1.TXT
and the second file is LONGNA~2.TXT

Now move longna~1.txt to \test2\
Then do dir /x again in \test1\.
You will see one file called longna~2.txt

If at this stage you could only see the longnames
in \test1\ and you tried converting longnameb.txt
to its short name by a script using regex or string
manipulation routines, you would wrongly conclude
that it is longna~1.txt.
That short name would not be acceptable to any app
(such as your VBS script) wanting the short name as input.
It would say "no such file".

Thus it is possible, in a folder containing only one file,
to have a file called abcdefghijklmn.txt whose short name
is abcdef~3.txt. That is recorded in its directory entry.

To complicate matters, if you move a long named file
to another directory, its long name is unchanged of course
but its short name is changed to use the lowest available
number after the ~, depending on what filenames currently
exist in the new directory.

Indeed, if you move the files one at a time from \test1
to \test2 in the right order, you can end up getting the
long to short translations changed, so that longnamea.txt
(which was longna~1.txt) becomes longna~2.txt.

Thus the only reliable method is to *read* (from the directory)
the short name associated with a long named file.
I am not aware of any small program which you can feed the
long name to and get the short name returned. I guess that
such a program exists ?
A new plugin to do that would be handy; or adding such a
service to the File plugin.

Anyway, such a plugin (or a script) would sometimes produce
errors if it tried to convert by simply truncating the name
to 6 chars and adding ~1.

Alan M



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/JV_rlB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to