openFileWithSize method

Future<(Smb2PoolHandle, int)> openFileWithSize(
  1. String path
)

Open a file and get its size in one call.

Returns (handle, fileSize). Saves a network round-trip vs calling fileSize + openFile separately.

Implementation

Future<(Smb2PoolHandle, int)> openFileWithSize(String path) async {
  var worker = _nextWorker;
  try {
    return await _openFileWithSizeOn(worker, path);
  } on Smb2Exception catch (e) {
    if (!_isConnectionError(e) || _closed) rethrow;
    worker = await _reconnectWorker(worker);
    return await _openFileWithSizeOn(worker, path);
  }
}