Closed skether closed 4 years ago
Just ran through the integration test project with a space in the path. I don't see failures in CanCreateFileInfo
, but I see errors in other tests. I'll try to get fixes for this up as soon as I can. Thanks for letting us know about this!
When you get a chance, can you share your wire up for everything related to SmbAbstraction
just so we can get a better picture as to why you are specifically seeing this error for FileInfo
This is my whole test project:
using System;
using SmbAbstraction;
namespace SmbAbstractionTest
{
class Program
{
static void Main()
{
var clientFactory = new SMB2ClientFactory();
var credentialProvider = new SMBCredentialProvider();
var credential = new SMBCredential(string.Empty, "user", "password", @"smb://127.0.0.1/TestFolder", credentialProvider);
var fs = new SMBFileSystem(clientFactory, credentialProvider);
var pathWithoutSpace = fs.FileInfo.FromFileName(@"smb://127.0.0.1/TestFolder/TestTest/file.txt");
var fileWithSpace = fs.FileInfo.FromFileName(@"smb://127.0.0.1/TestFolder/TestTest/file space.txt");
var pathWithSpace = fs.FileInfo.FromFileName(@"smb://127.0.0.1/TestFolder/Test Test/file.txt");
Console.WriteLine("Breakpoint");
}
}
}
I have SmbAbstraction v1.0.10 and System.IO.Abstractions v10.0.8 nugets installed.
I have tried on a remote domain joined server as well with the same results.
Just fixed this issue with https://github.com/jordanlytle/SmbAbstraction/pull/16
When using paths with the smb://
scheme paths still included the Uri escape symbols and were breaking when being operated against in the SMB client library.
Creating new package version now
Version 1.0.11 has these fixes. https://www.nuget.org/packages/SmbAbstraction/1.0.11
I am trying to access a file on a share with the following code:
The first two are working as expected. The last one where the space is in a directory name fails with the following exception:
All of the files exist and accessible.
Tested with version 1.0.10 and 1.0.6 on .NetCore 3.1
Thanks in advance!