MCPcopy Index your code
hub / github.com/hoothin/UserScripts / generateUnixExternalFileAttr

Function generateUnixExternalFileAttr

Picviewer CE+/dist.user.js:717–727  ·  view source on GitHub ↗
(unixPermissions, isDir)

Source from the content-addressed store, hash-verified

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

Callers 1

generateZipPartsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected