Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for IsPathSeparator (0.27 sec)

  1. internal/lock/lock_windows.go

    	copy(pathbuf, prefix)
    	n := len(path)
    	r, w := 0, len(prefix)
    	for r < n {
    		switch {
    		case os.IsPathSeparator(path[r]):
    			// empty block
    			r++
    		case path[r] == '.' && (r+1 == n || os.IsPathSeparator(path[r+1])):
    			// /./
    			r++
    		case r+1 < n && path[r] == '.' && path[r+1] == '.' && (r+2 == n || os.IsPathSeparator(path[r+2])):
    			// /../ is currently unhandled
    			return path
    		default:
    			pathbuf[w] = '\\'
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Oct 18 18:08:15 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  2. cmd/os_unix.go

    			return nil
    		}
    	}
    
    	// Slow path: make sure parent exists and then call Mkdir for path.
    	i := len(dirPath)
    	for i > 0 && os.IsPathSeparator(dirPath[i-1]) { // Skip trailing path separator.
    		i--
    	}
    
    	j := i
    	for j > 0 && !os.IsPathSeparator(dirPath[j-1]) { // Scan backward over element.
    		j--
    	}
    
    	if j > 1 {
    		// Create parent.
    		if err := osMkdirAll(dirPath[:j-1], perm, baseDir); err != nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 9.3K bytes
    - Viewed (0)
Back to top