mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 20:00:09 +00:00
Update package os for package path/filepath support on macOS
This commit is contained in:
@@ -8,6 +8,14 @@ SEPARATOR :: '/';
|
||||
SEPARATOR_STRING :: `/`;
|
||||
LIST_SEPARATOR :: ':';
|
||||
|
||||
is_reserved_name :: proc(path: string) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
is_abs :: proc(path: string) -> bool {
|
||||
return strings.has_prefix(path, "/");
|
||||
}
|
||||
|
||||
abs :: proc(path: string, allocator := context.allocator) -> (string, bool) {
|
||||
full_path, err := os.absolute_path_from_relative(path);
|
||||
if err != os.ERROR_NONE {
|
||||
@@ -17,10 +25,11 @@ abs :: proc(path: string, allocator := context.allocator) -> (string, bool) {
|
||||
}
|
||||
|
||||
join :: proc(elems: ..string, allocator := context.allocator) -> string {
|
||||
s := strings.join(elems, SEPARATOR_STRING);
|
||||
return s;
|
||||
}
|
||||
|
||||
is_abs :: proc(path: string) -> bool {
|
||||
return (path[0] == '/');
|
||||
}
|
||||
for e, i in elems {
|
||||
if e != "" {
|
||||
p := strings.join(elems[i:], SEPARATOR_STRING, context.temp_allocator);
|
||||
return clean(p, allocator);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
Reference in New Issue
Block a user