readAppPid function

int? readAppPid()

Reads the app VM PID from appPidFile written by fdb launch after the VM service is confirmed reachable.

Returns null if the file does not exist or its content is not a valid integer (e.g. the session was created by an older fdb version).

Implementation

int? readAppPid() {
  final file = File(appPidFile);
  if (!file.existsSync()) return null;
  final content = file.readAsStringSync().trim();
  return int.tryParse(content);
}