https://github.com/ryanflannery/exe_in_path
A small, portable C89 library to scan $PATH and check for an executable
https://github.com/ryanflannery/exe_in_path
Last synced: about 2 months ago
JSON representation
A small, portable C89 library to scan $PATH and check for an executable
- Host: GitHub
- URL: https://github.com/ryanflannery/exe_in_path
- Owner: ryanflannery
- License: isc
- Created: 2016-03-03T05:38:13.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-09T02:36:10.000Z (over 10 years ago)
- Last Synced: 2025-02-28T21:25:22.343Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Introduction
------------
[](LICENSE)
[](https://travis-ci.org/ryanflannery/exe_in_path)
This is a small portable C (strict C89) library that simply checks the `$PATH`
environment variable for an executable. If present, it returns true. Otherwise
it returns false.
Usually you would simply `exec*` for such a check, but doing so in a `fork()`'d
child process or similar can be more complicated than it's worth for such a
common error.
Details
-------
There's a single function exported by this library
```
bool exe_in_path(const char *e);
```
Semantics are pretty obvious.
Install
-------
Edit the variables in `Makefile` for where to install the .h and the lib.
Then
```
$ ./configure
$ make
$ make install
$ make test /* run gtests */
```
License
-------
The code is released under an ISC style license.