3
这似乎有点麻烦有没有更好的方法来找出文件或目录存在?
var fileExists =
new File(path).existsSync() ||
new Directory(path).existsSync() ||
new Link(path).existsSync()
是否有更短或更好的办法?
这似乎有点麻烦有没有更好的方法来找出文件或目录存在?
var fileExists =
new File(path).existsSync() ||
new Directory(path).existsSync() ||
new Link(path).existsSync()
是否有更短或更好的办法?
较短的方法是
FileSystemEntity.typeSync(path) != FileSystemEntityType.NOT_FOUND
又见https://github.com/dart-lang/sdk/issues/2883#issuecomment-108317456