folly: replace old-style header guards with "pragma once"
[folly.git] / folly / experimental / io / FsUtil.h
index f571e886f836a287eb9d16423215c1c31dc60658..85606d1c53cc06346f1c764599deef30033779b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2016 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_ */