feat: sftp perm setting & path copy (#467)

This commit is contained in:
lollipopkit🏳️‍⚧️
2024-07-18 21:40:40 +08:00
committed by GitHub
parent 5ee98f90e8
commit 076082c945
14 changed files with 248 additions and 48 deletions

View File

@@ -1,4 +1,5 @@
import 'package:dartssh2/dartssh2.dart';
import 'package:server_box/view/widget/unix_perm.dart';
extension SftpFileX on SftpFileMode {
String get str {
@@ -8,6 +9,26 @@ extension SftpFileX on SftpFileMode {
return '$user$group$other';
}
UnixPerm toUnixPerm() {
return UnixPerm(
user: RWX(
r: userRead,
w: userWrite,
x: userExecute,
),
group: RWX(
r: groupRead,
w: groupWrite,
x: groupExecute,
),
other: RWX(
r: otherRead,
w: otherWrite,
x: otherExecute,
),
);
}
}
String _getRoleMode(bool r, bool w, bool x) {