perl GetShortPathName!

S

sangeetha

Hi,

I'm facing problem in GetShortPathName function.

Case 1:
use Win32;
$shortpath = Win32::GetShortPathName( "c:/program files" );
print "$shortpath";

output: "c:/PROGRA~1"

Case 2:

$x= "c:/program Files/GNU/Case Study 1";
$shortpath = Win32::GetShortPathName($x);
print "$shortpath";

output: (nothing)

Actualy, i'm facing problem in creating the file(s) under the long
directory (including the blank space) name.. so i've writen the above
testcase to test whether the "GetShortPathName" is working or not !!

Can any one help me in this regard?

Thanks in advance

Sangeetha B
 
J

Jeff 'japhy' Pinyan

[posted & mailed]

$shortpath = Win32::GetShortPathName( "c:/program files" );
print "$shortpath";

output: "c:/PROGRA~1"

I'm sure the "c:/program files" directory exists...
$x= "c:/program Files/GNU/Case Study 1";
$shortpath = Win32::GetShortPathName($x);
print "$shortpath";

output: (nothing)

.... but it sounds like THAT directory doesn't exist, and you're trying to
generate the shortpath name for it.
Actualy, i'm facing problem in creating the file(s) under the long
directory (including the blank space) name.. so i've writen the above
testcase to test whether the "GetShortPathName" is working or not !!

If this is the case, perhaps the GetShortPathName() function merely
determines what the OS has already assigned as its short name; perhaps it
can't produce a short name for a non-existent directory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top