Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > perl GetShortPathName!

Reply
Thread Tools

perl GetShortPathName!

 
 
sangeetha
Guest
Posts: n/a
 
      08-11-2003
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
 
Reply With Quote
 
 
 
 
Jeff 'japhy' Pinyan
Guest
Posts: n/a
 
      08-11-2003
[posted & mailed]

On 11 Aug 2003, sangeetha wrote:

> $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.

--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 04-04-2011 10:00 PM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments