On Wed, 10 Jul 2002 13:35:50 +0100, you wrote:

>"David Otton" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> On Wed, 10 Jul 2002 13:14:44 +0100, you wrote:
>>
>> >I've got an application that requires dos folder names (8.3 standard) as
>> >input.
>> >
>> >I also have PHP, which quite happily can cope with both.
>> >
>> >Can someone help me write a function to translate full paths to dos paths

>> You may have to drop down to C/C++ and ask the OS to lookup the short
>> version of the path for you (GetShortPathName and GetShortPathNameW).
>> But if you want to do it "by hand", Knowledge Base article Q142982
>> might be a place to start.

>It doesn't matter how fast it does it.  It matters what language it does it.

It's nothing to do with speed... Windows uses (used?) a hack to
introduce long filename support while not breaking 8.3 filenames, and
it stores both on the disc. If you had three files named :

LongFilenameA.dat
LongFilenameB.dat
LongFilenameC.dat

they would be converted to

LongFi~1.dat
LongFi~2.dat
LongFi~3.dat

but you can't guarantee which long name maps to which short name. You
really have to ask the OS to do the lookup for you if you want correct
results.

AFAIK your choices to get at Windows stuff from PHP are the COM
functions, or writing a new function for PHP itself and recompiling.
(Someone'll be along in a minute to correct me if I'm wrong).

>C and C++ are a big no no as our company doesn't have a compiler (winblows).

*boggle*

Different worlds :)

Hmm. How about Java? The API there might be rich enough to do what you
want.

>Thanks for the pointer

Good luck.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to