()
| 199 | } |
| 200 | |
| 201 | export 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 | |
| 216 | function getFileNameFromContent(content: string) { |
| 217 | const file = getFileAccess().getFile(content); |
nothing calls this directly
no test coverage detected