Skip to content

Commit e7c356b

Browse files
committed
Debug Windows failures.
1 parent 21aed9c commit e7c356b

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

tiledb/sm/filesystem/local.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ LsObjects LocalFilesystem::ls_filtered_v2(
126126

127127
Status LocalFilesystem::ls(
128128
const std::string& path, std::vector<std::string>* paths) const {
129-
// Noop if the parent ` path ` is not a directory, do not error out.
130-
if (!is_dir(URI(path))) {
131-
return Status::Ok();
132-
}
133-
134129
for (auto& fs : ls_with_sizes(URI(path), false)) {
135130
paths->emplace_back(fs.path().native());
136131
}

tiledb/sm/filesystem/posix.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ void Posix::write(
363363

364364
std::vector<directory_entry> Posix::ls_with_sizes(
365365
const URI& uri, bool get_sizes) const {
366+
// Noop if the parent uri is not a directory, do not error out.
367+
if (!is_dir(uri)) {
368+
return {};
369+
}
370+
366371
std::string path = uri.to_path();
367372
struct dirent* next_path = nullptr;
368373
auto dir = PosixDIR::open(path);

tiledb/sm/filesystem/test/unit_uri.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ TEST_CASE("URI: Test is_timestamped_name", "[uri][is_timestamped_name]") {
332332
};
333333
for (const auto& test : test_uris) {
334334
URI uri(test.first);
335-
DYNAMIC_SECTION("Checking is_timestamped_name URI: " << test.first) {
335+
DYNAMIC_SECTION("URI: " << test.first) {
336336
CHECK(uri.is_timestamped_name() == test.second);
337337
}
338338
}

tiledb/sm/filesystem/uri.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,19 @@ bool URI::is_timestamped_name() const {
226226

227227
// Separator between uuid[_v].
228228
size_t uuid_separator = part.find('_', t2_separator + 1);
229-
std::string uuid =
230-
part.substr(t2_separator + 1, uuid_separator - t2_separator - 1);
229+
std::string uuid;
231230
std::string suffix;
232231
if (uuid_separator == std::string::npos) {
233232
// There is no version; Check the UUID for the final suffix.
233+
uuid = part.substr(t2_separator + 1);
234234
suffix = get_suffix(uuid);
235-
uuid = uuid.substr(0, uuid.size() - suffix.size());
235+
uuid.resize(uuid.size() - suffix.size());
236236
} else {
237+
uuid = part.substr(t2_separator + 1, uuid_separator - t2_separator - 1);
237238
std::string version = part.substr(uuid_separator + 1);
238239
// Check the version for the final suffix.
239240
suffix = get_suffix(version);
240-
version = version.substr(0, version.size() - suffix.size());
241+
version.resize(version.size() - suffix.size());
241242
if (version.size() > std::to_string(constants::format_version).size()) {
242243
return false;
243244
}

tiledb/sm/filesystem/win.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ bool Win::is_file(const URI& uri) const {
350350

351351
std::vector<directory_entry> Win::ls_with_sizes(
352352
const URI& uri, bool get_sizes) const {
353+
// Noop if the parent path is not a directory, do not error out.
354+
if (!is_dir(uri)) {
355+
return {};
356+
}
357+
353358
auto path = uri.to_path();
354359
bool ends_with_slash = path.length() > 0 && path[path.length() - 1] == '\\';
355360
const std::string glob = path + (ends_with_slash ? "*" : "\\*");

0 commit comments

Comments
 (0)