Used with "LensStudio:FileSystem".CopyDirOptions.
const fs = await import('LensStudio:FileSystem'); // Use TempDir for safe scratch paths const tmp = fs.TempDir.create(); const src = new Editor.Path(tmp.path.toString()).appended(new Editor.Path('source')); const dst = new Editor.Path(tmp.path.toString()).appended(new Editor.Path('destination')); fs.createDir(src, { recursive: true } as any); fs.createDir(dst, { recursive: true } as any); // CopyDirOptions: force (overwrite existing), recursive (include subdirs) fs.copyDir(src, dst, { force: true, recursive: true } as any); console.log('Copied directory with force + recursive options'); Copy
const fs = await import('LensStudio:FileSystem'); // Use TempDir for safe scratch paths const tmp = fs.TempDir.create(); const src = new Editor.Path(tmp.path.toString()).appended(new Editor.Path('source')); const dst = new Editor.Path(tmp.path.toString()).appended(new Editor.Path('destination')); fs.createDir(src, { recursive: true } as any); fs.createDir(dst, { recursive: true } as any); // CopyDirOptions: force (overwrite existing), recursive (include subdirs) fs.copyDir(src, dst, { force: true, recursive: true } as any); console.log('Copied directory with force + recursive options');
Protected
Snap Hidden
When true, overwrites existing files at the destination.
When true, copies nested subdirectories and their contents.
Used with "LensStudio:FileSystem".CopyDirOptions.
Example