Pash-Project / Pash

An Open Source reimplementation of Windows PowerShell, for Mono.
https://groups.google.com/group/pash-project
BSD 3-Clause "New" or "Revised" License
514 stars 54 forks source link

Cannot remove the file #401

Open ForNeVeR opened 9 years ago

ForNeVeR commented 9 years ago

It seems that our rm have some troubles deleting ordinary files from the file system.

PASH /tmp> touch 123
PASH /tmp> ls 123

Exists            : True
Name              : 123
IsReadOnly        : False
...

PASH /tmp> rm 123
The item at path '/tmp/123' has child items. Use recursion to remove it
  +CategoryInfo: NotSpecified, Reason: PSInvalidOperationException
  +FullyQualifiedErrorId: PSInvalidOperationException,

sh works in this case:

PASH /tmp> sh -c 'rm 123'
sburnicki commented 8 years ago

This seems to result from wrong logic in the FileSystemProvider's HasChildItem method. Feel free to try to fix it and add your test :) (I'm currently on long-term vacation, so I have no time for this ;))

ForNeVeR commented 8 years ago

@sburnicki no problems. I've just installed Pash from our shiny new official nixos package and started to document issues I face while using it in my environment.

I think I'll start fixing these issues in a couple of days.