mirror of
https://github.com/nini22P/iris.git
synced 2026-05-17 03:58:09 +08:00
18 lines
531 B
Dart
18 lines
531 B
Dart
import 'dart:io';
|
|
import 'package:path/path.dart' as p;
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
Future<String> getExecutableDirPath() async {
|
|
String resolvedExecutablePath = Platform.resolvedExecutable;
|
|
return p.dirname(resolvedExecutablePath);
|
|
}
|
|
|
|
Future<String> getTempPath() async {
|
|
final directory = await getTemporaryDirectory();
|
|
final String tempPath = p.join(directory.path, 'IRIS');
|
|
if (!Directory(tempPath).existsSync()) {
|
|
Directory(tempPath).createSync(recursive: true);
|
|
}
|
|
return tempPath;
|
|
}
|