mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-10-31 10:07:15 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			329 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			329 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // +build !linux
 | |
| 
 | |
| package common
 | |
| 
 | |
| import (
 | |
| 	"os"
 | |
| )
 | |
| 
 | |
| func SafeOsOpenFile(path string, flag int, perm os.FileMode) (*os.File, error) {
 | |
| 	if err := safePath(path); err != nil {
 | |
| 		Log.Debug("common::files safeOsOpenFile err[%s] path[%s]", err.Error(), path)
 | |
| 		return nil, ErrFilesystemError
 | |
| 	}
 | |
| 	return os.OpenFile(path, flag, perm)
 | |
| }
 | 
