// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build unix || (js && wasm) || wasip1

package os

const (
	PathSeparator     = '/' // OS-specific path separator
	PathListSeparator = ':' // OS-specific path list separator
)

// IsPathSeparator reports whether c is a directory separator character.
func ( uint8) bool {
	return PathSeparator == 
}

// basename removes trailing slashes and the leading directory name from path name.
func basename( string) string {
	 := len() - 1
	// Remove trailing slashes
	for ;  > 0 && [] == '/'; -- {
		 = [:]
	}
	// Remove leading directory name
	for --;  >= 0; -- {
		if [] == '/' {
			 = [+1:]
			break
		}
	}

	return 
}

// splitPath returns the base name and parent directory.
func splitPath( string) (string, string) {
	// if no better parent is found, the path is relative from "here"
	 := "."

	// Remove all but one leading slash.
	for len() > 1 && [0] == '/' && [1] == '/' {
		 = [1:]
	}

	 := len() - 1

	// Remove trailing slashes.
	for ;  > 0 && [] == '/'; -- {
		 = [:]
	}

	// if no slashes in path, base is path
	 := 

	// Remove leading directory path
	for --;  >= 0; -- {
		if [] == '/' {
			if  == 0 {
				 = [:1]
			} else {
				 = [:]
			}
			 = [+1:]
			break
		}
	}

	return , 
}

func volumeName( string) string {
	return ""
}