@@ -1223,6 +1223,11 @@ function rmSync(path, options) {
12231223function fdatasync ( fd , callback ) {
12241224 const req = new FSReqCallback ( ) ;
12251225 req . oncomplete = makeCallback ( callback ) ;
1226+
1227+ if ( permission . isEnabled ( ) ) {
1228+ callback ( new ERR_ACCESS_DENIED ( 'fdatasync API is disabled when Permission Model is enabled.' ) ) ;
1229+ return ;
1230+ }
12261231 binding . fdatasync ( fd , req ) ;
12271232}
12281233
@@ -1234,6 +1239,9 @@ function fdatasync(fd, callback) {
12341239 * @returns {void }
12351240 */
12361241function fdatasyncSync ( fd ) {
1242+ if ( permission . isEnabled ( ) ) {
1243+ throw new ERR_ACCESS_DENIED ( 'fdatasync API is disabled when Permission Model is enabled.' ) ;
1244+ }
12371245 binding . fdatasync ( fd ) ;
12381246}
12391247
@@ -1247,6 +1255,10 @@ function fdatasyncSync(fd) {
12471255function fsync ( fd , callback ) {
12481256 const req = new FSReqCallback ( ) ;
12491257 req . oncomplete = makeCallback ( callback ) ;
1258+ if ( permission . isEnabled ( ) ) {
1259+ callback ( new ERR_ACCESS_DENIED ( 'fsync API is disabled when Permission Model is enabled.' ) ) ;
1260+ return ;
1261+ }
12501262 binding . fsync ( fd , req ) ;
12511263}
12521264
@@ -1257,6 +1269,9 @@ function fsync(fd, callback) {
12571269 * @returns {void }
12581270 */
12591271function fsyncSync ( fd ) {
1272+ if ( permission . isEnabled ( ) ) {
1273+ throw new ERR_ACCESS_DENIED ( 'fsync API is disabled when Permission Model is enabled.' ) ;
1274+ }
12601275 binding . fsync ( fd ) ;
12611276}
12621277
@@ -2187,6 +2202,11 @@ function futimes(fd, atime, mtime, callback) {
21872202 mtime = toUnixTimestamp ( mtime , 'mtime' ) ;
21882203 callback = makeCallback ( callback ) ;
21892204
2205+ if ( permission . isEnabled ( ) ) {
2206+ callback ( new ERR_ACCESS_DENIED ( 'futimes API is disabled when Permission Model is enabled.' ) ) ;
2207+ return ;
2208+ }
2209+
21902210 const req = new FSReqCallback ( ) ;
21912211 req . oncomplete = callback ;
21922212 binding . futimes ( fd , atime , mtime , req ) ;
@@ -2202,6 +2222,10 @@ function futimes(fd, atime, mtime, callback) {
22022222 * @returns {void }
22032223 */
22042224function futimesSync ( fd , atime , mtime ) {
2225+ if ( permission . isEnabled ( ) ) {
2226+ throw new ERR_ACCESS_DENIED ( 'futimes API is disabled when Permission Model is enabled.' ) ;
2227+ }
2228+
22052229 binding . futimes (
22062230 fd ,
22072231 toUnixTimestamp ( atime , 'atime' ) ,
0 commit comments