#24 #25 #33 new: sftp file edit

This commit is contained in:
lollipopkit
2023-05-28 18:21:03 +08:00
parent dbabe81e3c
commit 06be4503ca
28 changed files with 329 additions and 173 deletions

View File

@@ -0,0 +1,15 @@
import 'package:dartssh2/dartssh2.dart';
extension SftpFile on SftpFileMode {
String get str {
final user = getRoleMode(userRead, userWrite, userExecute);
final group = getRoleMode(groupRead, groupWrite, groupExecute);
final other = getRoleMode(otherRead, otherWrite, otherExecute);
return '$user$group$other';
}
}
String getRoleMode(bool r, bool w, bool x) {
return '${r ? 'r' : '-'}${w ? 'w' : '-'}${x ? 'x' : '-'}';
}