(path string, extended bool)
| 335 | } |
| 336 | |
| 337 | func (*ServerImpl) fileInfoInternal(path string, extended bool) (*wshrpc.FileInfo, error) { |
| 338 | cleanedPath := filepath.Clean(wavebase.ExpandHomeDirSafe(path)) |
| 339 | finfo, err := os.Stat(cleanedPath) |
| 340 | if os.IsNotExist(err) { |
| 341 | return &wshrpc.FileInfo{ |
| 342 | Path: wavebase.ReplaceHomeDir(path), |
| 343 | Dir: computeDirPart(path), |
| 344 | NotFound: true, |
| 345 | ReadOnly: checkIsReadOnly(cleanedPath, finfo, false), |
| 346 | SupportsMkdir: true, |
| 347 | }, nil |
| 348 | } |
| 349 | if err != nil { |
| 350 | return nil, fmt.Errorf("cannot stat file %q: %w", path, err) |
| 351 | } |
| 352 | rtn := statToFileInfo(cleanedPath, finfo, extended) |
| 353 | if extended { |
| 354 | rtn.ReadOnly = checkIsReadOnly(cleanedPath, finfo, true) |
| 355 | } |
| 356 | return rtn, nil |
| 357 | } |
| 358 | |
| 359 | func resolvePaths(paths []string) string { |
| 360 | if len(paths) == 0 { |
no test coverage detected