Skip to content

Directory.deleteSync(recursive: true) throwing exception in Windows because directory is not empty. #16264

Closed
@DartBot

Description

@DartBot

This issue was originally filed by @bgourlie


While running tests in the angular.dart project, the following exception is being thrown:

Uncaught Error: FileSystemException: Deletion failed, path = C:\Users\WBRIAN~1.G
OU\AppData\Local\Temp\5f0862c7-844a-11e3-bead-3c970e7fe5b2 (OS Error: The direct
ory is not empty.
, errno = 145)
Stack Trace:

­0 _Directory._deleteSync (directory_impl.dart:188)

­1 FileSystemEntity.deleteSync (file_system_entity.dart:339)

­2 main.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:/

//C:/Users/w.brian.gourlie/Documents/GitHub/angular.dart/test/io/template_cache_
generator_spec.dart:33:24)

­3 _Future._propagateToListeners.<anonymous closure> (dart:async/future_imp

l.dart:481)

­4 _rootRun (dart:async/zone.dart:683)

­5 _RootZone.run (dart:async/zone.dart:832)

­6 _Future._propagateToListeners (dart:async/future_impl.dart:445)

­7 _Future._complete (dart:async/future_impl.dart:303)

­8 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:

­9 _asyncRunCallback (dart:async/schedule_microtask.dart:18)

­10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dar

t:119)

The code causing this exception is "tmpDir.deleteSync(recursive: true);"

I would expect this not to fail since it is a recursive delete.

Dart Editor version 1.1.1.release (STABLE)
Dart SDK version 1.1.1
Windows 8.1 x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions