Mon Jul 06 04:23:15 2009: Request 47574 was acted upon.
Transaction: Correspondence added by sisyph...@optusnet.com.au
       Queue: Win32-File
     Subject: Re: [rt.cpan.org #47574] 
   Broken in: 0.06
    Severity: Critical
       Owner: Nobody
  Requestors: xrmb-m...@gmx.net
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=47574 >



----- Original Message ----- 
From: "xrmb via RT" <bug-win32-f...@rt.cpan.org>

> I'm using active state perl 5.10.1004, and when I try to use
> SetAttributes to set the compress flag I get a true return value
> (indicating ok?), but the file is not compressed.

Win32::File::SetAttributes() calls the Windows API function
SetFileAttributesA(), and that function is not capable of enacting
compression of the file or of setting the compression attributes flag.

This is documented at
http://msdn.microsoft.com/en-us/library/aa365535(VS.85).aspx and should
probably be documented in the Win32::File pod as well. (I think it's the
lack of documentation in the Win32::File pod that's the bug.)
The constant COMPRESSED, exported by Win32::File is really only of use with
Win32::File::GetAttributes().
The same applies to DIRECTORY.

Although SetAttributes returns true, I think you should find (by using
GetAttributes) that the 'compressed' attribute was *not*, in fact, set.

Seems odd that SetAttributes() returns true when trying (and failing) to set
COMPRESSED and DIRECTORY attributes .... it does so simply because that's
what FileSetAttributesA() returns.

Cheers,
Rob


Reply via email to