Welcome to the Xceed Community | Help
Community Search  

Data descriptor record and the "3rd bit" of the general purpose bit flag

Sort Posts: Previous Next
  •  11-19-2008, 9:18 PM Post no. 17041

    Data descriptor record and the "3rd bit" of the general purpose bit flag

    It appears that Real-time Zip, when creating a new zip archive, is writing a value of 0x0008 to the general purpose bit flag of the local file header to indicate the use of data descriptor records.  The zip specification states that bit 3 should be set to indicate this.  Another tool I've used to parse existing zip files looks for a value of 0x0004 in that field.

    My question is, who is right?  I can see if you are counting bits using 0-based counting, then bit 3 turned "on" would be 0x0008.  But if you assume 1-based counting then bit 3 turned "on" would be 0x0004.

    My initial thought is that Real-time Zip is in error and is actually flipping bit 4 by writing the value 0x0008.

    -Steve 

  •  11-20-2008, 4:32 PM Post no. 17071 in reply to 17041

    Re: Data descriptor record and the "3rd bit" of the general purpose bit flag

    We indeed use zero-based counting. So to set bit 3 is to use the value 0x8, which, in binary will be 1000.

    If you look at the Zip specification, it also uses zero-based counting when talking about bitfields.


    André
    Software Developer and Tech Support
    Xceed Software Inc.
  •  11-20-2008, 11:06 PM Post no. 17076 in reply to 17071

    Re: Data descriptor record and the "3rd bit" of the general purpose bit flag

    Great, thanks for the clarification!
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.