How to set the current working directory in Dart? [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-31 00:30:36

问题


In a dart console application, how do I set the current working directory?


回答1:


import 'dart:io';
... 
Directory.current = new Directory('your/path/here'); 

or just

Directory.current = 'your/path/here';

See also https://api.dartlang.org/133671/dart-io/Directory/current.html



来源:https://stackoverflow.com/questions/33020117/how-to-set-the-current-working-directory-in-dart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!