MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / checkFile

Method checkFile

daemon/src/entity/file_writer.ts:46–57  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

44 let counter = 1;
45
46 const checkFile = async (name: string) => {
47 const absolutePath = fileManager.toAbsolutePath(path.normalize(path.join(dir, name)));
48 const isLock = await lockfile
49 .check(absolutePath)
50 .then((isLock) => isLock)
51 .catch(() => false);
52 const isAccess = await fs
53 .access(absolutePath)
54 .then(() => true)
55 .catch(() => false);
56 return isAccess && !isLock && !overwrite;
57 };
58
59 while (await checkFile(tempFileSaveName)) {
60 if (counter == 1) {

Callers

nothing calls this directly

Calls 2

toAbsolutePathMethod · 0.80
checkMethod · 0.80

Tested by

no test coverage detected