Skip to content

Instantly share code, notes, and snippets.

@jakemac53
Created June 10, 2024 18:01
Show Gist options
  • Save jakemac53/845b60847dbda53f93aeed8056d5fbd2 to your computer and use it in GitHub Desktop.
Save jakemac53/845b60847dbda53f93aeed8056d5fbd2 to your computer and use it in GitHub Desktop.
import 'dart:io';
import 'package:path/path.dart' as p;
void main() async {
late File test;
try {
test = File.fromUri(Uri.file(p.absolute('test.')));
print(await test.exists());
await test.copy('test.copy');
} catch (_) {
print('error copying ${test.uri}');
}
try {
test = File('test.');
print(await test.exists());
await test.copy('test.copy');
} catch (_) {
print('error copying ${test.uri}');
}
try {
test = File.fromUri(Uri.file('test.'));
print(await test.exists());
await test.copy('test.copy');
} catch (_) {
print('error copying ${test.uri}');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment