mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 01:50:50 +08:00 
			
		
		
		
	 bd40dcfc2b
			
		
	
	bd40dcfc2b
	
	
	
		
			
			* If possible, update each dependency to the latest available version. * Use releases over commit IDs and avoid vendoring branches. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
		
			
				
	
	
		
			25 lines
		
	
	
		
			496 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			496 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package longpath
 | |
| 
 | |
| import (
 | |
| 	"path/filepath"
 | |
| 	"strings"
 | |
| )
 | |
| 
 | |
| // LongAbs makes a path absolute and returns it in NT long path form.
 | |
| func LongAbs(path string) (string, error) {
 | |
| 	if strings.HasPrefix(path, `\\?\`) || strings.HasPrefix(path, `\\.\`) {
 | |
| 		return path, nil
 | |
| 	}
 | |
| 	if !filepath.IsAbs(path) {
 | |
| 		absPath, err := filepath.Abs(path)
 | |
| 		if err != nil {
 | |
| 			return "", err
 | |
| 		}
 | |
| 		path = absPath
 | |
| 	}
 | |
| 	if strings.HasPrefix(path, `\\`) {
 | |
| 		return `\\?\UNC\` + path[2:], nil
 | |
| 	}
 | |
| 	return `\\?\` + path, nil
 | |
| }
 |