/// <inheritdoc/> public Task<IUnixFileSystemEntry> GetEntryByNameAsync(IUnixDirectoryEntry directoryEntry, string name, CancellationToken cancellationToken) { var searchDirInfo = ((DotNetDirectoryEntry)directoryEntry).Info; var fullPath = Path.Combine(searchDirInfo.FullName, name); IUnixFileSystemEntry result; if (File.Exists(fullPath)) result = new DotNetFileEntry(this, new FileInfo(fullPath)); else if (Directory.Exists(fullPath)) result = new DotNetDirectoryEntry(this, new DirectoryInfo(fullPath), false); else result = null; return Task.FromResult(result); }
/// <inheritdoc/> public Task <IUnixFileSystemEntry> GetEntryByNameAsync(IUnixDirectoryEntry directoryEntry, string name, CancellationToken cancellationToken) { var searchDirInfo = ((DotNetDirectoryEntry)directoryEntry).Info; var fullPath = Path.Combine(searchDirInfo.FullName, name); IUnixFileSystemEntry result; if (File.Exists(fullPath)) { result = new DotNetFileEntry(this, new FileInfo(fullPath)); } else if (Directory.Exists(fullPath)) { result = new DotNetDirectoryEntry(this, new DirectoryInfo(fullPath), false); } else { result = null; } return(Task.FromResult(result)); }