How can I run the dir command from the Dart VM? When I try to use it with the Process class I get “unhandled exceptions”.
How can I run the dir command from the Dart VM? When I try
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Thanks to Søren Gjesse for the answer, who originally posted this to the Dart mailing list.
You cannot just run
diron Windows as it is not a standalone executable but build intocmd.exe. The following code will rundirand print the result:See also the Dart IO library for more on processes.