dart_smb2 0.0.6
dart_smb2: ^0.0.6 copied to clipboard
Flutter SMB2/3 client built on top of libsmb2. Targets macOS, Windows, Linux, iOS and Android.
0.0.6 24-04-2026 #
- Core: Added
Smb2Pool.withFile(path, body, {knownSize})and scopedSmb2File— opens a read handle, runs the callback, guaranteescloseHandleon any exit (exception, early return, cancellation). Replaces theopenFileWithSize+readFromHandle+closeHandleboilerplate at every call site. - Core: Added
Smb2Pool.downloadToFile(path, File destFile, {chunkSize, onProgress, isCanceled})— one-call download of an SMB file to a localFilestreaming through a single persistent handle. - Core: Added
onProgress(received, total)andisCanceled()callbacks toSmb2Pool.streamFile. Cancellation throwsSmb2Exception; the handle is always closed. - Core: Added a
FinalizeronSmb2PoolHandlethat best-effort-closes handles leaked by the caller. Safety net only — prefer explicitcloseHandleorwithFilefor deterministic cleanup. - Fixed:
streamFilewas implemented on top ofreadFileRange, which doesopen + pread + closeper chunk — a 50 MiB read in 1 MiB chunks meant 50 SMB2 Create/Close pairs on the wire. It now uses a single persistent handle (1 Create + N Reads + 1 Close) and chunks at libsmb2's server-negotiatedMaxReadSize. - Fixed:
Smb2Pool.fsyncHandleandftruncateHandlenow go through the auto-reconnect path. A disconnect mid-operation previously surfaced a raw worker-send failure instead of a clean reconnect + retry. - Fixed:
closeHandleis idempotent; calling it twice on the same handle is a no-op (previously it would fail with "Invalid handle" on the second call). - Breaking: Removed
Smb2Isolate. It duplicatedSmb2Pool(workers: 1)with a divergent error format and no auto-reconnect. UseSmb2Pool.connect(..., workers: 1)instead. - Example: Added test cards for
withFile,downloadToFile,openFileWithSize,fsyncHandle, and an Error Classification card that exercisesstat/exists/deleteFileon missing paths and reports the resolvedSmb2ErrorType. WiredonProgressinto thestreamFilecard. - README: Rewrote around
Smb2Poolas the default entry point. New sections: Scoped File Access (withFile), Download to File, Low-Level File Handles. - Build: Patched libsmb2's completion callbacks (
create_cb_1,fstat_cb_1,getinfo_cb_3,trunc_cb_3,rename_cb_3,ftrunc_cb_1) to populate the NT error on the context viasmb2_set_nterror. Previouslystat/exists/mkdir/rmdir/deleteFile/rename/truncate/ftruncatesilently surfaced asSmb2ErrorType.unknownwitherrno=0and an empty message on any failure — soexists()could not detectfileNotFoundandmkdir()could not detectalreadyExists. 10 previously-failing integration tests now pass. - Build: Updated binaries to
libsmb2-r4.
0.0.5 12-04-2026 #
- Fixed: Incorrect lib version in
.podspec.
0.0.4 12-04-2026 #
- Fixed: Linux
libsmb2.sowas built as ARM64 (Docker default on Apple Silicon) and failed to load on x86_64 hosts; build now forces--platform=linux/amd64. - Fixed: Windows
libsmb2.dllhad unbundled MinGW runtime dependencies (libgcc_s_seh-1.dll,libwinpthread-1.dll); now statically linked with-static -static-libgcc. - Fixed:
Smb2Exception: Poll failedon Android and Linux during connect — patched libsmb2sync.cto retrypoll()onEINTR(signals from ART/Dart VM were aborting the syscall). - Build: Updated binaries to
libsmb2-r3.
0.0.3 12-04-2026 #
- Fixed: transport failures (
POLLHUP,POLLERR, socket read/write errors, connect failures, lost tree-id after server-side idle teardown, …) now classify asSmb2ErrorType.connectioninstead ofunknown.
0.0.2 09-04-2026 #
- Core: write operations, write handles, file management (
mkdir,rmdir,deleteFile,rename,truncate), filesystem info (statvfs,readlink,echo,fsync,ftruncate,exists), security options (seal,signing,version),Smb2Versionenum,Smb2StatVfstype, native binaries updated tolibsmb2-r2. - Fixed: libsmb2 thread safety mutex, zero-copy isolate transfers,
Smb2Isolate.disconnect()graceful shutdown,streamWriteno retry on failure, unified error encoding, write loop infinite hang,fileSize()now throws,truncate()negative length validation, allocator consistency,listdircapacity overflow,TransferableTypedDatafresh per retry. - Example: Flutter app with server management, 12 read tests, 10 write tests.
- Build: Updated binaries to
libsmb2-r2.
0.0.1+2 08-04-2026 #
- Fixed AndroidManifest.xml.
0.0.1+1 08-04-2026 #
- Minor fixes.
0.0.1 07-04-2026 #
- Initial release.