Copy File API
-
Struggling with this.
Here's the API
File.copy(var target)
Here's my code
LicenseFile.copy(FileSystem.getFolder(FileSystem.AppData));
No errors but not copied file either. Any ideas?
-
@DanH Are you sure that
LicenseFile
exists? I haven't checked but it could be that the target has to be a file not a directory:LicenseFile.copy(FileSystem.getFolder(FileSystem.AppData).getChildFile("MyLicense.txt"));
-
@d-healey aha that was it, thanks!
-
-
@d-healey If you copy a file somewhere you must ensure that the parent directory exists or the copy action will fail (because it will never implicitly create directories).
-
@d-healey it needed to be written / copied to a file, not a directory