Last active
March 4, 2019 10:28
-
-
Save fd/fb618ff2b0a9526be55c35b139965863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { permissions, revokePermission, open } = Deno; | |
const encoder = new TextEncoder(); | |
const logPromise = open('request.log', 'a+'); | |
// Revoke all permissions | |
const perms = permissions(); | |
for (const perm in perms) { | |
if (perms[perm]) { | |
console.log('revoked '+perm); | |
revokePermission(perm as any); | |
} | |
} | |
console.log(permissions()); | |
(async () => { | |
const logfile = await logPromise; | |
await logfile.write(encoder.encode("hello\n")); | |
await open('some other file', 'a+'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment