| 715 | * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only |
| 716 | */ |
| 717 | var generateUnixExternalFileAttr = function (unixPermissions, isDir) { |
| 718 | |
| 719 | var result = unixPermissions; |
| 720 | if (!unixPermissions) { |
| 721 | // I can't use octal values in strict mode, hence the hexa. |
| 722 | // 040775 => 0x41fd |
| 723 | // 0100664 => 0x81b4 |
| 724 | result = isDir ? 0x41fd : 0x81b4; |
| 725 | } |
| 726 | return (result & 0xFFFF) << 16; |
| 727 | }; |
| 728 | |
| 729 | /** |
| 730 | * Generate the DOS part of the external file attributes. |