sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Directory.watch Windows vs Mac case inconsistency

Open davidmorgan opened this issue 3 days ago • 3 comments

Not sure if this is coming from the OS or from the VM implementation; if it's the VM implementation maybe it could be made consistent, that would be nice.

On Windows the events seem to use the case from the file(s) on disk, on Mac they use the case from the file operation.

import 'dart:io';

void main() async {
  final temp = Directory.systemTemp.createTempSync();
  final sep = Platform.pathSeparator;
  temp.watch().listen(print);
  File('${temp.path}${sep}a').createSync();
  File('${temp.path}${sep}A').deleteSync();
  await Future.delayed(Duration(milliseconds: 100));
}

prints a delete event with lower case a on Windows, on Mac it's upper case A.

davidmorgan avatar Dec 08 '25 12:12 davidmorgan