[Mono-bugs] [Bug 613226] New: FileStream.Name returns invalid value when using specific constructor overload
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Jun 10 08:52:00 EDT 2010
http://bugzilla.novell.com/show_bug.cgi?id=613226
http://bugzilla.novell.com/show_bug.cgi?id=613226#c0
Summary: FileStream.Name returns invalid value when using
specific constructor overload
Classification: Mono
Product: Mono: Class Libraries
Version: 2.6.x
Platform: All
OS/Version: Mac OS X 10.6
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: silver83 at gmail.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
Created an attachment (id=368424)
--> (http://bugzilla.novell.com/attachment.cgi?id=368424)
Patch for FileStream.cs (diffed against 2.4.2.3)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4
Tested against 2.4.2.3, 2.6.4.
FileStream.Name property is "Unknown" When using the ctor overload :
public FileStream (string path, FileMode mode, FileAccess access, FileShare
share, int bufferSize, bool useAsync)
This is because of incorrect constructor chain. Patch (for 2.4.2.3 branch) is
attached.
Test case :
static void Main(string[] args)
{
string path = "test.txt";
File.WriteAllText(path, "***************************");
FileStream fs = new FileStream(path, FileMode.OpenOrCreate,
FileAccess.ReadWrite, FileShare.None, 1024 * 8, true);
if (fs.Name.EndsWith("test.txt"))
Console.WriteLine("ALL OK !");
else
Console.WriteLine("Something Bad Happened, name was '{0}' !",
fs.Name);
}
Reproducible: Always
Steps to Reproduce:
1. Run test program
Actual Results:
program outputs "Something Bad Happened, name was '[Unknown]' !"
Expected Results:
program outputs "All OK !"
--
Configure bugmail: http://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