lidavidm commented on a change in pull request #12150:
URL: https://github.com/apache/arrow/pull/12150#discussion_r784838047



##########
File path: cpp/src/arrow/io/test_common.cc
##########
@@ -48,6 +52,28 @@ void AssertFileContents(const std::string& path, const 
std::string& contents) {
 
 bool FileExists(const std::string& path) { return 
std::ifstream(path.c_str()).good(); }
 
+Status PurgeLocalFileFromOsCache(const std::string& path) {
+#ifdef _WIN32
+  return Status::NotImplemented("Cannot yet purge files from cache on 
Windows");
+#else
+  int fd = open(path.c_str(), O_WRONLY);
+  if (fd < 0) {
+    return IOErrorFromErrno(errno, "open on ", path,
+                            " to clear from cache did not succeed.");
+  }
+  int err = posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);

Review comment:
       Ah, it also seems this isn't supported on MacOS: 
https://github.com/apache/arrow/runs/4811739968?check_suite_focus=true#step:7:779




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to