MCPcopy Create free account
hub / github.com/TruthHun/BookStack / generateUnixExternalFileAttr

Function generateUnixExternalFileAttr

static/word2md/mammoth.browser.js:13054–13065  ·  view source on GitHub ↗
(unixPermissions, isDir)

Source from the content-addressed store, hash-verified

13052 * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only
13053 */
13054var generateUnixExternalFileAttr = function (unixPermissions, isDir) {
13055
13056 var result = unixPermissions;
13057 if (!unixPermissions) {
13058 // I can't use octal values in strict mode, hence the hexa.
13059 // 040775 => 0x41fd
13060 // 0100664 => 0x81b4
13061 result = isDir ? 0x41fd : 0x81b4;
13062 }
13063
13064 return (result & 0xFFFF) << 16;
13065};
13066
13067/**
13068 * Generate the DOS part of the external file attributes.

Callers 1

generateZipPartsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected