Fixed permissions bug! changed strtoul(header->ar_mode, NULL, 0) to strtoul(header->ar_mode, NULL, 8)