why new Process(‘cd /root’) not work ?
var p1 = new Process('cd /root');
trace(p1.stdout.readAll().toString());
trace(new Process('ls').stdout.readAll().toString());//still in the old path,instead of root path.
Platform: hashlnk and neko
why new Process(‘cd /root’) not work ?
var p1 = new Process('cd /root');
trace(p1.stdout.readAll().toString());
trace(new Process('ls').stdout.readAll().toString());//still in the old path,instead of root path.
Platform: hashlnk and neko
Because it’s new Proces('cd', ['/root'])
Because it’s new Proces('cd', ['/root'])
it’s still not work. still on current folder.
It wouldn’t work in a shell either $(cd /root) ; ls
, each process have their own current directory.
You are looking for Sys.setCwd
.
© 2018-2020 Haxe Foundation - Powered by Discourse