(path: string | URL, mode: number)
| 42 | * @param mode A sequence of 3 octal numbers representing file permissions. |
| 43 | */ |
| 44 | export async function chmod(path: string | URL, mode: number) { |
| 45 | if (isDeno) { |
| 46 | await Deno.chmod(path, mode); |
| 47 | } else { |
| 48 | try { |
| 49 | await getNodeFs().promises.chmod(path, mode); |
| 50 | } catch (error) { |
| 51 | throw mapError(error); |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Synchronously changes the permission of a specific file/directory of |
no test coverage detected