[Mono-bugs] [Bug 703007] New: DirectoryInfo.MoveTo doesn't update DirectoryInfo.Name
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed Jun 29 14:23:21 EDT 2011
https://bugzilla.novell.com/show_bug.cgi?id=703007
https://bugzilla.novell.com/show_bug.cgi?id=703007#c0
Summary: DirectoryInfo.MoveTo doesn't update DirectoryInfo.Name
Classification: Mono
Product: Mono: Class Libraries
Version: SVN
Platform: x86-64
OS/Version: Mac OS X 10.6
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: jstaten07+novell at gmail.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
Created an attachment (id=437541)
--> (http://bugzilla.novell.com/attachment.cgi?id=437541)
c# file to reproduce issue
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)
AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.801.0 Safari/535.1
Calling DirectoryInfo.MoveTo will not change the DirectoryInfo.Name. This has
side effects such as after calling Refresh(), the Exists property value will be
based upon the old name, and not the new.
Also, calling Delete() after MoveTo(), even after a Refresh(), will result in a
DirectoryNotFoundException.
This behavior does not match that of .NET 4
Reproducible: Always
Steps to Reproduce:
1. Pull down dirinfo.cs from attachment or https://gist.github.com/1054337
2. Compile with `mcs dirinfo.cs`
3. Execute `mono dirinfo.exe`
Actual Results:
Exists:False Name:buzz
Create()
Exists:False Name:buzz
Refresh()
Exists:True Name:buzz
MoveTo("zing")
Exists:True Name:buzz
Refresh()
Exists:False Name:buzz
Delete()
Unhandled Exception: System.IO.DirectoryNotFoundException: Directory does not
exist.
at System.IO.Directory.Delete (System.String path) [0x00000] in <filename
unknown>:0
at System.IO.Directory.Delete (System.String path, Boolean recursive)
[0x00000] in <filename unknown>:0
at System.IO.DirectoryInfo.Delete (Boolean recursive) [0x00000] in <filename
unknown>:0
at System.IO.DirectoryInfo.Delete () [0x00000] in <filename unknown>:0
at Program.Main () [0x00000] in <filename unknown>:0
Expected Results:
Exists:False Name:buzz
Create()
Exists:False Name:buzz
Refresh()
Exists:True Name:buzz
MoveTo("zing")
Exists:True Name:zing
Refresh()
Exists:True Name:zing
Delete()
Exists:True Name:zing
Refresh()
Exists:False Name:zing
[~]mono --version
Mono JIT compiler version 2.11 (master/e00fb73 Wed Jun 29 10:10:10 MDT 2011)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors.
www.mono-project.com
TLS: normal
SIGSEGV: normal
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC)
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list