Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F804777
dump.rs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
899 B
Referenced Files
None
Subscribers
None
dump.rs
View Options
use
crate
::{
file
::{
self
,
Exists
},
helpers
,
process
::{
id
::
Id
,
Runner
},
};
use
colored
::
Colorize
;
use
global_placeholders
::
global
;
use
macros_rs
::{
crashln
,
string
};
use
std
::{
collections
::
BTreeMap
,
fs
};
pub
fn
read
()
->
Runner
{
if
!
Exists
::
file
(
global
!
(
"pmc.dump"
)).
unwrap
()
{
let
runner
=
Runner
{
id
:
Id
::
new
(
0
),
process_list
:
BTreeMap
::
new
(),
};
write
(
&
runner
);
log
::
info
!
(
"created dump file"
);
}
file
::
read
(
global
!
(
"pmc.dump"
))
}
pub
fn
write
(
dump
:
&
Runner
)
{
let
contents
=
match
toml
::
to_string
(
dump
)
{
Ok
(
contents
)
=>
contents
,
Err
(
err
)
=>
crashln
!
(
"{} Cannot parse dump.
\n
{}"
,
*
helpers
::
FAIL
,
string
!
(
err
).
white
()),
};
if
let
Err
(
err
)
=
fs
::
write
(
global
!
(
"pmc.dump"
),
contents
)
{
crashln
!
(
"{} Error writing dumpfile.
\n
{}"
,
*
helpers
::
FAIL
,
string
!
(
err
).
white
())
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 29, 12:50 PM (21 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
200461
Default Alt Text
dump.rs (899 B)
Attached To
Mode
rPMC Process Management Controller
Attached
Detach File
Event Timeline
Log In to Comment