Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Win32::GetShortPath doesn't always return an 8.3 short Path?

by maa (Pilgrim)
on Mar 04, 2004 at 19:28 UTC ( [id://333986]=note: print w/replies, xml ) Need Help??


in reply to Win32::GetShortPath doesn't always return an 8.3 short Path?

Perhaps the module thinks that it's already a short name as you used the C:\Progra~1\ in your test... a reliable (if _bad_) way would be to issue a my $dir=system("cmd /c dir /x $file"); and then pattern match to capture the bit you wanted?

Replies are listed 'Best First'.
Re: Re: Win32::GetShortPath doesn't always return an 8.3 short Path?
by jimbojones (Friar) on Mar 09, 2004 at 14:55 UTC
    Hi,

    Thanks for the responses. The directory does exist. The "problem" is one with the filesystem. Turns out, if you set a Windows Registry key
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem\NtfsDis +able8dot3NameCreation
    the filesystem will not allow a short file name to be aliased to the long file. The sysadmins on the machine had set this key for security purposes. I assume that the GetShortPath routine calls the system dll, assuming the "short" value returned is in 8.3 format, although it's now not guarenteed to be. So it's not a Perl problem per se, although the Perl doc is not absolutely correct.

    Again, thanks for the responses.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://333986]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found