@@ -5,108 +5,12 @@ import * as pathUtilities from 'path';
55import * as fs from 'fs' ;
66import * as fsx from 'fs-extra' ;
77
8- import { Text , NewlineKind } from './Text' ;
8+ import { Text , NewlineKind , Encoding } from './Text' ;
9+ import { PosixModeBits } from './PosixModeBits' ;
910
1011// The PosixModeBits are intended to be used with bitwise operations.
1112// tslint:disable:no-bitwise
1213
13- /**
14- * The allowed types of encodings, as supported by Node.js
15- * @public
16- */
17- export const enum Encoding {
18- Utf8 = 'utf8'
19- }
20-
21- /**
22- * An integer value used to specify file permissions for POSIX-like operating systems.
23- *
24- * @remarks
25- *
26- * This bitfield corresponds to the "mode_t" structure described in this document:
27- * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
28- *
29- * It is used with NodeJS APIs such as fs.Stat.mode and fs.chmodSync(). These values
30- * represent a set of permissions and can be combined using bitwise arithmetic.
31- *
32- * POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.
33- *
34- * @public
35- */
36- export const enum PosixModeBits {
37- // The bits
38-
39- /**
40- * Indicates that the item's owner can read the item.
41- */
42- UserRead = 1 << 8 ,
43-
44- /**
45- * Indicates that the item's owner can modify the item.
46- */
47- UserWrite = 1 << 7 ,
48-
49- /**
50- * Indicates that the item's owner can execute the item (if it is a file)
51- * or search the item (if it is a directory).
52- */
53- UserExecute = 1 << 6 ,
54-
55- /**
56- * Indicates that users belonging to the item's group can read the item.
57- */
58- GroupRead = 1 << 5 ,
59-
60- /**
61- * Indicates that users belonging to the item's group can modify the item.
62- */
63- GroupWrite = 1 << 4 ,
64-
65- /**
66- * Indicates that users belonging to the item's group can execute the item (if it is a file)
67- * or search the item (if it is a directory).
68- */
69- GroupExecute = 1 << 3 ,
70-
71- /**
72- * Indicates that other users (besides the item's owner user or group) can read the item.
73- */
74- OthersRead = 1 << 2 ,
75-
76- /**
77- * Indicates that other users (besides the item's owner user or group) can modify the item.
78- */
79- OthersWrite = 1 << 1 ,
80-
81- /**
82- * Indicates that other users (besides the item's owner user or group) can execute the item (if it is a file)
83- * or search the item (if it is a directory).
84- */
85- OthersExecute = 1 << 0 ,
86-
87- // Helpful aliases
88-
89- /**
90- * A zero value where no permissions bits are set.
91- */
92- None = 0 ,
93-
94- /**
95- * An alias combining OthersRead, GroupRead, and UserRead permission bits.
96- */
97- AllRead = OthersRead | GroupRead | UserRead ,
98-
99- /**
100- * An alias combining OthersWrite, GroupWrite, and UserWrite permission bits.
101- */
102- AllWrite = OthersWrite | GroupWrite | UserWrite ,
103-
104- /**
105- * An alias combining OthersExecute, GroupExecute, and UserExecute permission bits.
106- */
107- AllExecute = OthersExecute | GroupExecute | UserExecute
108- }
109-
11014/**
11115 * The options for FileSystem.readFolder()
11216 * @public
0 commit comments