Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,4 @@ $RECYCLE.BIN/

# Windows shortcuts
*.lnk
.windsurf/
24 changes: 24 additions & 0 deletions ClientExamples.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,30 @@ if (status == NTStatus.STATUS_SUCCESS)
status = fileStore.Disconnect();
```

Enable DFS support on a file store:
===================================
```cs
ISMBFileStore fileStore = client.TreeConnect("Shared", out status);
if (status == NTStatus.STATUS_SUCCESS)
{
// Wrap with DFS support (disabled by default)
DfsClientOptions options = new DfsClientOptions { Enabled = true };
ISMBFileStore dfsStore = DfsClientFactory.CreateDfsAwareFileStore(fileStore, null, options);

// Use dfsStore normally - DFS paths are resolved automatically
object directoryHandle;
FileStatus fileStatus;
status = dfsStore.CreateFile(out directoryHandle, out fileStatus, @"\DfsLink\Subfolder", AccessMask.GENERIC_READ, FileAttributes.Directory, ShareAccess.Read | ShareAccess.Write, CreateDisposition.FILE_OPEN, CreateOptions.FILE_DIRECTORY_FILE, null);
if (status == NTStatus.STATUS_SUCCESS)
{
List<QueryDirectoryFileInformation> fileList;
status = dfsStore.QueryDirectory(out fileList, directoryHandle, "*", FileInformationClass.FileDirectoryInformation);
status = dfsStore.CloseFile(directoryHandle);
}
}
status = fileStore.Disconnect();
```

Connect to share and list files and directories - SMB2:
=======================================================
```cs
Expand Down
4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ You can share anything from actual directories to custom objects, as long as the

Client code examples can be found [here](ClientExamples.md).

DFS Client Support:
===================
SMBLibrary provides opt-in DFS (Distributed File System) client support. Wrap any `ISMBFileStore` with `DfsClientFactory.CreateDfsAwareFileStore()` to enable automatic DFS path resolution. See [ClientExamples.md](ClientExamples.md) for usage.

NuGet Packages:
===============
[SMBLibrary](https://www.nuget.org/packages/SMBLibrary/) - Cross-platform server and client implementation.
Expand Down
Loading