2019-07-01 17:04:09 +02:00
|
|
|
module os
|
|
|
|
|
|
|
|
#include <dirent.h>
|
2019-07-16 01:57:03 +02:00
|
|
|
|
|
|
|
const (
|
|
|
|
PathSeparator = '/'
|
2019-07-18 20:21:48 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// get_error_msg return error code representation in string.
|
|
|
|
pub fn get_error_msg(code int) string {
|
|
|
|
_ptr_text := C.strerror(code) // voidptr?
|
|
|
|
if _ptr_text == 0 {
|
|
|
|
return ''
|
|
|
|
}
|
|
|
|
return tos(_ptr_text, C.strlen(_ptr_text))
|
|
|
|
}
|