Skip to main content

dart_smb2 0.2.0 copy "dart_smb2: ^0.2.0" to clipboard
dart_smb2: ^0.2.0 copied to clipboard

Dart client for SMB2/3 built on libsmb2. Listings, reads, streaming, atomic downloads, writes and cancellation from worker isolates. Targets macOS, Windows, Linux, iOS and Android.

example/example.dart

// Minimal dart_smb2 example
import 'package:dart_smb2/dart_smb2.dart';

Future<void> main() async {
  // Connect a pool of worker isolates to a share.
  final pool = await Smb2Pool.connect(
    host: '192.168.1.10',
    share: 'Music',
    user: 'alice',
    password: 'secret',
  );

  try {
    // List the share's root.
    for (final entry in await pool.listDirectory('')) {
      print(entry.isDirectory ? '${entry.name}/' : entry.name);
    }

    // Download a file to disk, atomically.
    await pool.downloadToFile('Album/01 - Intro.flac', '/tmp/intro.flac');
  } on Smb2Exception catch (e) {
    print('${e.type.name}: ${e.message}');
  } finally {
    await pool.disconnect();
  }
}
8
likes
0
points
7.97k
downloads

Publisher

verified publisherales-drnz.com

Weekly Downloads

Dart client for SMB2/3 built on libsmb2. Listings, reads, streaming, atomic downloads, writes and cancellation from worker isolates. Targets macOS, Windows, Linux, iOS and Android.

Repository (GitHub)
View/report issues

Topics

#cross-platform #smb2 #smb3 #samba #libsmb2

License

unknown (license)

Dependencies

code_assets, crypto, ffi, hooks, meta

More

Packages that depend on dart_smb2