Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F624530
system.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
987 B
Referenced Files
None
Subscribers
None
system.cpp
View Options
#include
<string>
#include
"system.h"
#include
<stdint.h>
#ifndef WINDOWS
#include
<unistd.h>
#include
<sys/stat.h>
#include
<sys/time.h>
#endif
#ifndef WINDOWS
static
bool
isReadable
(
const
std
::
string
&
path
){
#ifndef WII
if
(
access
(
path
.
c_str
(),
R_OK
)
==
0
){
return
true
;
}
else
{
return
false
;
}
#else
/* FIXME */
return
true
;
#endif
}
bool
System::isDirectory
(
const
std
::
string
&
path
){
struct
stat
info
;
if
(
stat
(
path
.
c_str
(),
&
info
)
==
0
){
if
(
S_ISDIR
(
info
.
st_mode
)
==
1
){
return
true
;
}
else
{
return
false
;
}
}
return
false
;
}
bool
System::readableFile
(
const
std
::
string
&
path
){
return
isReadable
(
path
)
&&
!
isDirectory
(
path
);
}
bool
System::readable
(
const
std
::
string
&
path
){
return
isReadable
(
path
);
}
uint64_t
System::currentMicroseconds
(){
struct
timeval
hold
;
gettimeofday
(
&
hold
,
NULL
);
return
hold
.
tv_sec
*
1000
*
1000
+
hold
.
tv_usec
;
}
#endif
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Nov 14, 10:26 PM (9 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
129850
Default Alt Text
system.cpp (987 B)
Attached To
Mode
R75 R-Tech1
Attached
Detach File
Event Timeline