MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / copyTest

Function copyTest

apps/toolbox/src/pages/fs-helper.ts:201–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199}
200
201export function copyTest() {
202 const now = Date.now();
203 const tempFile = File.fromPath(path.join(knownFolders.temp().path, `${now}.txt`));
204 tempFile.writeTextSync('Hello World: ' + now);
205 const tempCopy = File.fromPath(path.join(knownFolders.temp().path, `${now}-copy.txt`));
206 tempFile
207 .copy(tempCopy.path)
208 .then((done) => {
209 console.log('done: ' + done + '\n' + 'Original path: ' + tempFile.path + '\n' + 'Copied to: ' + tempCopy.path + '\n' + 'Original size: ' + tempFile.size + '\n' + 'Copy size: ' + tempCopy.size + '\n');
210 })
211 .catch((error) => {
212 console.log(error);
213 });
214}
215
216function getFileNameFromContent(content: string) {
217 const file = getFileAccess().getFile(content);

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
writeTextSyncMethod · 0.65
copyMethod · 0.65
fromPathMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected