Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2572035
globals.rs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
globals.rs
View Options
use
global_placeholders
::
init
;
use
macros_rs
::
crashln
;
use
pmc
::
config
;
use
pmc
::
file
::
Exists
;
use
pmc
::
helpers
;
use
std
::
fs
;
pub
fn
init
()
{
match
home
::
home_dir
()
{
Some
(
path
)
=>
{
let
path
=
path
.
display
();
if
!
Exists
::
folder
(
format!
(
"{path}/.pmc/"
)).
unwrap
()
{
fs
::
create_dir_all
(
format!
(
"{path}/.pmc/"
)).
unwrap
();
log
::
info
!
(
"created pmc base dir"
);
}
let
config
=
config
::
read
();
if
!
Exists
::
folder
(
config
.
runner
.
log_path
.
clone
()).
unwrap
()
{
fs
::
create_dir_all
(
&
config
.
runner
.
log_path
).
unwrap
();
log
::
info
!
(
"created pmc log dir"
);
}
init
!
(
"pmc.base"
,
format!
(
"{path}/.pmc/"
));
init
!
(
"pmc.log"
,
format!
(
"{path}/.pmc/pmc.log"
));
init
!
(
"pmc.pid"
,
format!
(
"{path}/.pmc/daemon.pid"
));
init
!
(
"pmc.dump"
,
format!
(
"{path}/.pmc/process.dump"
));
init
!
(
"pmc.daemon.kind"
,
config
.
daemon
.
kind
);
init
!
(
"pmc.daemon.log"
,
format!
(
"{path}/.pmc/daemon.log"
));
let
out
=
format!
(
"{}/{{}}-out.log"
,
config
.
runner
.
log_path
);
let
error
=
format!
(
"{}/{{}}-error.log"
,
config
.
runner
.
log_path
);
init
!
(
"pmc.logs.out"
,
out
);
init
!
(
"pmc.logs.error"
,
error
);
}
None
=>
crashln
!
(
"{} Impossible to get your home directory"
,
*
helpers
::
FAIL
),
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 15, 4:53 PM (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
484861
Default Alt Text
globals.rs (1 KB)
Attached To
Mode
rPMC Process Management Controller
Attached
Detach File
Event Timeline
Log In to Comment