void FilesystemBinding::GetRootDirectories(const ValueList& args, KValueRef result) { try { Poco::Path path; std::vector<std::string> roots; path.listRoots(roots); KListRef rootList = new StaticBoundList(); for(size_t i = 0; i < roots.size(); i++) { ti::File* file = new ti::File(roots.at(i)); KValueRef value = Value::NewObject((KObjectRef) file); rootList->Append(value); } KListRef list = rootList; result->SetList(list); } catch (Poco::Exception& exc) { throw ValueException::FromString(exc.displayText()); } }