perl GetShortPathName!

Discussion in 'Perl Misc' started by sangeetha, Aug 11, 2003.

  1. sangeetha

    sangeetha Guest

    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
    sangeetha, Aug 11, 2003
    #1
    1. Advertising

  2. [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)
    Jeff 'japhy' Pinyan, Aug 11, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,765
  2. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Jan 23, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    283
    PerlFAQ Server
    Jan 23, 2011
  3. PerlFAQ Server
    Replies:
    0
    Views:
    651
    PerlFAQ Server
    Feb 3, 2011
  4. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Feb 27, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    275
    PerlFAQ Server
    Feb 27, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    658
    PerlFAQ Server
    Apr 4, 2011
Loading...

Share This Page