enh(ProcessRunner): does not detect launch errors #4482 (#4483)

* enh(ProcessRunner): does not detect launch errors #4482

* enh(File): add absolutePath and existsAnywhere() #4482

* fix windows build and tsan fail

* fix tsan

* fix windows file tests

* comment out some CI env path -related issues

* fix tsan and windows build

* try to fix ci

* ignore ProcessRunner test fail on windows cmake

* enh(File): canExecute throws FileNotFoundException if the file to be executed can't be found in the path.

* Few C++ modernisation changes.

* enh(File): Windows specifics of File::canExecute. Returns false if the file to be executed can't be found using absolutePath.

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
This commit is contained in:
Aleksandar Fabijanic
2024-07-29 13:16:18 -05:00
committed by GitHub
parent f24547cdcf
commit 3656f069e1
20 changed files with 361 additions and 37 deletions

View File

@@ -54,7 +54,7 @@ class Foundation_API File: private FileImpl
/// use the forward slash ("/") as directory separator.
{
public:
typedef FileSizeImpl FileSize;
using FileSize = FileSizeImpl;
enum LinkType
/// Type of link for linkTo().
@@ -84,7 +84,7 @@ public:
File(const File& file);
/// Copy constructor.
virtual ~File();
~File() override;
/// Destroys the file.
File& operator = (const File& file);
@@ -105,9 +105,24 @@ public:
const std::string& path() const;
/// Returns the path.
std::string absolutePath() const;
/// Returns absolute path.
/// Attempts to find the existing file
/// using curent work directory and the PATH
/// environment variable.
/// If the file doesn't exist, returns empty string.
bool exists() const;
/// Returns true iff the file exists.
bool existsAnywhere() const;
/// If the file path is relative, searches
/// for the file in the current working directory
/// and the environment paths.
/// If the file path is absolute, the
/// functionality is identical to the
/// exists() call.
bool canRead() const;
/// Returns true iff the file is readable.