FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pico-java/helpers_linux.cpp at main · minirop/pico-java · GitHub
minirop
/
pico-java
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
4
Code
Issues
0
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
pico-java
/
helpers_linux.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (25 loc) · 610 Bytes
Breadcrumbs
pico-java
/
helpers_linux.cpp
Copy path
File metadata and controls
31 lines (25 loc) · 610 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
include
"
helpers.h
"
#
include
<
fmt/format.h
>
#
ifdef
DEBUG
#
define
OUTPUT
"
"
#
else
#
define
OUTPUT
"
>/dev/null 2>&1
"
#
endif
namespace
helpers
{
bool
can_execute
(std::string exename)
{
auto
cmd =
fmt::format
(
"
which {} {}
"
, exename,
OUTPUT
);
return
system
(cmd.
data
()) ==
0
;
}
bool
execute
(std::string exename, std::string args)
{
auto
cmd =
fmt::format
(
"
{} {} {}
"
, exename, args,
OUTPUT
);
return
system
(cmd.
data
()) ==
0
;
}
bool
copy
(std::string source, std::string destination)
{
auto
cmd =
fmt::format
(
"
cp {} {} {}
"
, source, destination,
OUTPUT
);
return
system
(cmd.
data
()) ==
0
;
}
}
Back
|
FazBrowse Home
|
New Git URL