| 220 | } |
| 221 | |
| 222 | std::vector<Path> DiskUtils::listDirectory(const Path& path) { |
| 223 | auto pathStr = path.toString(); |
| 224 | std::vector<Path> out; |
| 225 | |
| 226 | auto* dir = opendir(pathStr.c_str()); |
| 227 | if (dir != nullptr) { |
| 228 | struct dirent* dp = nullptr; |
| 229 | while ((dp = readdir(dir)) != nullptr) { |
| 230 | std::string_view filepath(dp->d_name); |
| 231 | |
| 232 | if (filepath != ".." && filepath != ".") { |
| 233 | out.emplace_back(path.appending(filepath)); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | closedir(dir); |
| 238 | } |
| 239 | |
| 240 | return out; |
| 241 | } |
| 242 | |
| 243 | Path DiskUtils::temporaryFilePath() { |
| 244 | char tempFileName[L_tmpnam]; |