in reply to Re^3: How to remove COMPRESSED attribute with Win32::File?
in thread How to remove COMPRESSED attribute with Win32::File?

Sample of code to add/remove the compress attribute.

$file_fullname="c:/temp/archiving.ini"; Win32::File::GetAttributes($file_fullname, $attr); if ($attr & COMPRESSED) { print "File is compressed. --> UnCompress \n"; $file_fullname=&change_file_to_uncompressed($file_fullname); } else { print "File is NOT compressed. --> Compress \n"; $file_fullname=&change_file_to_compressed($file_fullname); } sub change_file_to_compressed { my(@args) = @_; my $file_to_modify = $args[0]; $attrib_compress= "compact /C $file_to_modify"; qx "$attrib_compress"; } sub change_file_to_uncompressed { my(@args) = @_; my $file_to_modify = $args[0]; $attrib_compress= "compact /U $file_to_modify"; qx "$attrib_compress"; }