Quest For a Reliable GetFileInfo function or Win32::API experts

Ian Taite ian.taite at zen.co.uk
Sat Oct 26 10:25:01 CDT 2002


Dear All,

I'm trying to write a service for Win32 systems that performs a software inventory every-so-often by waking up to call the Win32::AdminMisc::GetFileInfo function for EVERY file on the system (yes, expensive I know but it is the most reliable way).

What I've found is that this function works most of the time but sometimes, for no obvious reason, it just dies. As in Perl.exe dies, not just the script, so there's no Perl error message and back to the command prompt. I've stripped the script down to the absolute bare minimum, i.e. no service code, and it still crashes.

As I have posted requests for help direct to Dave Roth (who maintains the Win32::AdminMisc module), and to the Perl-NT-Admins group on Topica without success, and I have tried different versions of  ActivePerl 5.6, generally starting with build 629 onwards, without success.

I'm left wondering how to solve the problem. If someone wrote me a reliable gui-less GiveFileDetails.exe in C++ I'd be happy as performance is not really an important factor (I'll settle for reliability first).

A while ago I tried to use the Win32::API module to call the Win32::GetFileVersionInfoEx (or something close to that), and what I got back was a unicode string that didn't know how to decode. The info I needed was in the string, (Data::Dumper showed it was there), but I just couldn't spot the pattern. There's probably an API function for converting unicode into "locale" specific string format, but I didn't think to work that through at the time. There's also a Win32::API::Prototype module available now that wasn' t at the time that might make it even easier to call the required functions.

Anyone got the required experience to help here, or would be prepared to help with the dirty job of using Win32::API or Win32::API::Protoype.

It galls me that this can't be done in Perl !

Regards,
Ian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/archives/manchester-pm/attachments/20021026/fd14a777/attachment.htm


More information about the Manchester-pm mailing list