File tree 1 file changed +10
-7
lines changed
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -200,13 +200,16 @@ Deno.test(
200
200
} ,
201
201
) ;
202
202
203
- Deno . test ( "chmod" , async function ( ) {
203
+ Deno . test ( "[node/fs filehandle. chmod] Change the permissions of the file " , async function ( ) {
204
204
const fileHandle = await fs . open ( testData ) ;
205
- await fileHandle . chmod ( 0o666 ) ;
206
- const info1 = await Deno . stat ( testData ) ;
207
- assertEquals ( info1 . mode ?. toString ( 8 ) , `100666` ) ;
208
- await fileHandle . chmod ( 0o600 ) ;
209
- const info2 = await Deno . stat ( testData ) ;
210
- assertEquals ( info2 . mode ?. toString ( 8 ) , `100600` ) ;
205
+
206
+ const readOnly = 0o400 ;
207
+ await fileHandle . chmod ( readOnly . toString ( 8 ) ) ;
208
+ assertEquals ( Deno . statSync ( testData ) . mode ! & 0o777 , readOnly ) ;
209
+
210
+ const readWrite = 0o600 ;
211
+ await fileHandle . chmod ( readWrite . toString ( 8 ) ) ;
212
+ assertEquals ( Deno . statSync ( testData ) . mode ! & 0o777 , readWrite ) ;
213
+
211
214
await fileHandle . close ( ) ;
212
215
} ) ;
You can’t perform that action at this time.
0 commit comments