UNPKG

@u4/adbkit

Version:

A Typescript client for the Android Debug Bridge.

64 lines 2.01 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const stats64_1 = __importDefault(require("./stats64")); class Entry64 extends stats64_1.default { constructor(name, error, dev, ino, mode, nlink, uid, gid, size, atimeNs, mtimeNs, ctimeNs) { super(error, dev, ino, mode, nlink, uid, gid, size, atimeNs, mtimeNs, ctimeNs); this.name = name; } toString() { let out = ''; if (this.isDirectory()) { out += 'd'; } else if (this.isSymbolicLink()) { out += 'l'; } else if (this.isBlockDevice()) { out += 'd'; } else if (this.isFile()) { out += '-'; } else if (this.isCharacterDevice()) { out += 'c'; } else if (this.isFIFO()) { out += 'p'; } else if (this.isSocket()) { out += 's'; } else { out += '?'; } const mode = Number(this.mode); out += (mode & 256) ? 'r' : '-'; out += (mode & 128) ? 'w' : '-'; out += (mode & 64) ? 'x' : '-'; out += (mode & 32) ? 'r' : '-'; out += (mode & 16) ? 'w' : '-'; out += (mode & 8) ? 'x' : '-'; out += (mode & 4) ? 'r' : '-'; out += (mode & 2) ? 'w' : '-'; out += (mode & 1) ? 'x' : '-'; out += ' '; out += this.gid.toString().padStart(5, ' '); out += ' '; out += this.uid.toString().padStart(5, ' '); out += ' '; out += this.size.toString().padStart(10, ' '); out += ' '; out += this.ctime.toISOString().substring(0, 10); out += ' '; out += this.name; out += ' '; out = out.padEnd(60, ' '); return out; } } exports.default = Entry64; //# sourceMappingURL=entry64.js.map