Im not sure but you may also want to check out stat() which might have the
full filename in it somewhere.  Im stabbing in the dark, though, as I have
never written a Perl script for Win32.

- Jim


----- Original Message ----- 
From: "Jenda Krynicky" <[EMAIL PROTECTED]>
To: "beginners" <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 4:51 AM
Subject: Re: Name of current perl script on Win32


| From: "Gazi, Nasser (London)" <[EMAIL PROTECTED]>
| > How can I find the name the perl script on Win32?
| > 
| > I know that the usual way is to use $0
| > 
| > However, this gives me a problem on Win32 with filenames bigger than 8
| > characters, where $0 returns filename filename like "FIILEMAME~" which
| > is useless to me.
| 
| perldoc Win32
| 
|     Win32::GetLongPathName(PATHNAME)
|         [CORE] Returns a representation of PATHNAME composed of 
| longname
|         components (if any). The result may not necessarily be longer 
| than
|         PATHNAME. No attempt is made to convert PATHNAME to the 
| absolute
|         path. Compare with Win32::GetShortPathName and
|         Win32::GetFullPathName.
| 
|         This function has been added for Perl 5.6.
| 
| So
| $path = Win32::GetLongPathName($0);
| should work.
| 
| Jenda
| ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
| When it comes to wine, women and song, wizards are allowed 
| to get drunk and croon as much as they like.
| -- Terry Pratchett in Sourcery
| 
| 
| -- 
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| 
| 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to