Hi Christian, On Apr 22 14:50, Christian Franke wrote: > Cygwin 2.8.0 returns stat.st_blocks = 0 if a file is compressed with > CompactOS method (at least on Win10 1607): > [...] > This is because StandardInformation.AllocationSize is always 0 for theses > files. CompressedFileSize returns the correct value. > > This is likely related to the interesting method how these files are encoded > in the MFT: > The default $DATA stream is a sparse stream with original size but no > allocated blocks. > An alternate $DATA stream WofCompressedData contains the compressed data. > An additional $REPARSE_POINT possibly marks this file a special and lets > accesses fail on older Windows releases (and on Linux, most current forensic > tools, ...). > > With the attached patch, stat.st_blocks work as expected: > [...] > - else if (::has_attribute (attributes, FILE_ATTRIBUTE_COMPRESSED > - | FILE_ATTRIBUTE_SPARSE_FILE) > + else if ((pfai->StandardInformation.AllocationSize.QuadPart == 0LL > + || ::has_attribute (attributes, FILE_ATTRIBUTE_COMPRESSED > + | FILE_ATTRIBUTE_SPARSE_FILE))
Are you saying these files actually have no FILE_ATTRIBUTE_COMPRESSED bit set??? Thanks, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat
signature.asc
Description: PGP signature