www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20647] New: rmdirRecurse and remove cannot remove readonly


          Issue ID: 20647
           Summary: rmdirRecurse and remove cannot remove readonly files
                    on windows
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: johnnymarler gmail.com

It would be helpful for phobos to provide a way to remove readonly files on

A common use case is when removing git repositories.  On windows, git creates
readonly files inside its ".git" sub-directory.  This means phobos' `remove`
and `rmdirRecurse` functions will fail when trying to delete directories that
contain git repositories.

To remove readonly files on windows, you must remove the READONLY file
attribute.  I'd like to see phobos provide functionality to remove files and
directories with readonly files in them.

Mar 07 2020