MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / canReadWrite

Function canReadWrite

src/shared/Util.ts:386–397  ·  view source on GitHub ↗
(folder: string)

Source from the content-addressed store, hash-verified

384 * @param folder folder to check
385 */
386export async function canReadWrite(folder: string): Promise<boolean> {
387 const testPath = path.join(folder, 'test');
388 try {
389 const fd = await fs.promises.open(testPath, 'w');
390 // Cleanup file after testing
391 await fd.close();
392 await fs.promises.unlink(testPath);
393 return true;
394 } catch {
395 return false;
396 }
397}
398
399// Courtesy of https://www.paulirish.com/2009/random-hex-color-code-snippets/
400export function getRandomHexColor(): string {

Callers

nothing calls this directly

Calls 2

closeMethod · 0.65
openMethod · 0.45

Tested by

no test coverage detected