(unixPermissions, isDir)
| 38 | * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only |
| 39 | */ |
| 40 | var generateUnixExternalFileAttr = function (unixPermissions, isDir) { |
| 41 | |
| 42 | var result = unixPermissions; |
| 43 | if (!unixPermissions) { |
| 44 | // I can't use octal values in strict mode, hence the hexa. |
| 45 | // 040775 => 0x41fd |
| 46 | // 0100664 => 0x81b4 |
| 47 | result = isDir ? 0x41fd : 0x81b4; |
| 48 | } |
| 49 | return (result & 0xFFFF) << 16; |
| 50 | }; |
| 51 | |
| 52 | /** |
| 53 | * Generate the DOS part of the external file attributes. |