MCPcopy Create free account
hub / github.com/Stuk/jszip / generateUnixExternalFileAttr

Function generateUnixExternalFileAttr

lib/generate/ZipFileWorker.js:40–50  ·  view source on GitHub ↗
(unixPermissions, isDir)

Source from the content-addressed store, hash-verified

38 * ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only
39 */
40var 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.

Callers 1

generateZipPartsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected