ns_file_coordinator_util 0.5.0
ns_file_coordinator_util: ^0.5.0 copied to clipboard
Helper functions for `NSFileCoordinator` (iOS/macOS only).
Helper functions for NSFileCoordinator
(iOS/macOS only).
Usage #
NOTE: this plugin doesn't automatically call startAccessingSecurityScopedResource
. You can call it yourself with accessing_security_scoped_resource;
/// Reads an iCloud [src] file and copies it to [dest].
Future<void> readFile(String src, String dest);
/// Gets the contents of an iCloud directory [path] and returns an array of [NsFileCoordinatorEntity].
Future<List<NsFileCoordinatorEntity>> listContents(String path);
/// Deletes the given iCloud [path].
Future<void> delete(String path) async;
/// Moves [src] path to [dest].
Future<void> move(String src, String dest);
/// Copies [src] path to iCloud [dest].
Future<void> copy(String src, String dest);
/// Checks if the given iCloud [path] exists.
Future<bool> exists(String path) async;
/// Creates a directory [path] like [mkdir -p].
Future<void> mkdir(String path) async;
Example:
final plugin = NsFileCoordinatorUtil();
await plugin.readFile(src, dest);