[Mono-bugs] [Bug 377049] New: When the file is locked File. Move moves instead of throwing IOException

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 4 00:06:15 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=377049


           Summary: When the file is locked File.Move moves instead of
                    throwing IOException
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: albright at wesay.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


[Test]
[ExpectedException(typeof(IOException))]
public void FileLocks()
{
  string temporaryFile = Path.GetTempFileName();
  string temporaryFile1 = Path.Combine(Path.GetTempPath(),
                                       Path.GetRandomFileName());

  using (File.Open(temporaryFile, 
                   FileMode.Open, 
                   FileAccess.ReadWrite, 
                   FileShare.None))
  {
      File.Move(temporaryFile, temporaryFile1);
  }

}


-- 
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