add file info name field
This commit is contained in:
parent
bc74966f28
commit
903cc0333c
1 changed files with 4 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import 'dart:async';
|
|||
import 'dart:io';
|
||||
import 'package:oto_cli/oto/commands/command.dart';
|
||||
import 'package:oto_cli/oto/data/command_data.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class FileRead extends Command {
|
||||
@override
|
||||
|
|
@ -76,6 +77,9 @@ class FileInfo extends Command {
|
|||
var stat = await file.stat();
|
||||
var map = <String, dynamic>{};
|
||||
map['path'] = file.path;
|
||||
map['name'] = path.basename(file.path);
|
||||
map['withoutExtentionName'] = path.withoutExtension(map['baseName']);
|
||||
map['extension'] = path.extension(file.path);
|
||||
map['symbolicPath'] = await file.resolveSymbolicLinks();
|
||||
map['size'] = stat.size;
|
||||
map['accessed'] = stat.accessed.toString();
|
||||
|
|
|
|||
Loading…
Reference in a new issue