Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Win32 Strustured Storage via File - Properties - Summary

by John M. Dlugosz (Monsignor)
on Sep 07, 2001 at 20:27 UTC ( [id://110933]=note: print w/replies, xml ) Need Help??


in reply to Win32 Strustured Storage via File - Properties - Summary

Yea, I went to a w2k machine and added some summary info, and then see:
   :♣SebiesnrMkudrfcoIaamtykdDa:$DATA	136
   :♣SummaryInformation:$DATA	128
   :{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}:$DATA	0
I tried writing to a secondary stream in Perl and did so; then I tried doing it with ♣SummaryInformation and failed. Perhaps the funny character is messing it up?

For those not familiar with Windows, the club is really a character code 0x0005. The DOS OEM code page shows a clubsuit for that code point. So maybe there's a translation happening between ANSI/OEM code pages when you try to open the file. Try turning ON the Wide System Call support, and use \x{0005} explicitly in the name, and see if that works for you.

—John

  • Comment on Re: Win32 Strustured Storage via File - Properties - Summary

Replies are listed 'Best First'.
Re: Re: Win32 Strustured Storage via File - Properties - Summary
by idnopheq (Chaplain) on Sep 07, 2001 at 21:26 UTC
    Check this out!

    #!/usr/bin/perl -wT use strict; open ( AAA, "$ARGV[0]:\x{0005}SummaryInformation" ) or die "Cannot open: $!\n"; while ( <AAA> ) { print "$_\n"; }
    WOOHOO! I can read it, now. But can I set it. Have to fire up hexl-mode.el

    Thanks All! I'll post my final code when I'm done!

    UPDATE: http://msdn.microsoft.com/library/en-us/com/hh/com/stgasstg_7agk.asp has assitional programming information about this.

    HTH
    --
    idnopheq
    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

      So, it was the literal chr(5) getting munged?

      Hmm, that's odd. As written, it will convert the Unicode to ANSI using the current code page before calling the OS primitive. Ah, it probably passes the 5 unchanged (thus breaking symetry: a 5 is converted to the club character.)

      Just to be more kosher, I'd use Wide system calls, or use a byte-oriented string.

      How to read it: Load it in and use the OLE interface to un-persist it. I think you need to read it as one binary lump.

      Here's a suggestion when you get past the proof stages: have a tied hash to get/set Summary Info or other supported property sets.

      —John

        For what it is worth... I found a COM object on the M$ support site call dsofile (Article # 224351) that will do what you are looking for. I was able to call it using the WIN32::OLE module. I have posted an example of doing this in the Snippets call SetFileProperty

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-06-20 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.