logging: fix compiler compatibility for one more constexpr function
[folly.git] / folly / experimental / io / FsUtil.h
index d0f52488c786fb4cac71f7e7bac8210e8d4971bc..cfa4c4f2d59b4d46733dbf7a7a70d9316e5eef50 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,7 @@
  * limitations under the License.
  */
 
-#ifndef FOLLY_IO_FSUTIL_H_
-#define FOLLY_IO_FSUTIL_H_
+#pragma once
 
 #include <boost/filesystem.hpp>
 
@@ -52,7 +51,19 @@ path remove_prefix(const path& p, const path& prefix);
  */
 path canonical_parent(const path& p, const path& basePath = current_path());
 
+/**
+ * Get the path to the current executable.
+ *
+ * Note that this is not reliable and not recommended in general; it may not be
+ * implemented on your platform (in which case it will throw), the executable
+ * might have been moved or replaced while running, and applications comprising
+ * of multiple executables should use some form of configuration system to
+ * find the other executables rather than relying on relative paths from one
+ * to another.
+ *
+ * So this should only be used for tests, logging, or other innocuous purposes.
+ */
+path executable_path();
+
 }  // namespace fs
 }  // namespace folly
-
-#endif /* FOLLY_IO_FSUTIL_H_ */