[Mono-list] File system access permission problem with Mono

FX Meta rednaxela0607 at hotmail.com
Tue Oct 2 02:27:15 EDT 2007

Last week when I was dealing with my .NET course homework assignment, I had a problem when running the program with Mono
The assignment was about creating a user control that shows the file system hierarchy on the left in a TreeView, and the contents of a selected directory on the right in a ListView. I started the solution in Visual Studio 2008 Beta 2, and everything worked fine on it. Then I thought it might be fun to try running the program on Mono without recompiling, but then I had a problem with a file called "pagefile.sys", which is a [+archive][+hidden][+system] page file for caching. The program ran fine on Mono (on Windows XP SP2), except that when it came across this file, whose path is @"F:\pagefile.sys", it raised an exception saying that the file was not found, in System.IO.FileInfo.get_Length(). That was confusing because no problem occured when running the program with .NET Framework 3.5 Beta 2. I tried to avoid the exception by filtering out files with [+hidden] and [+system] attributes before a call to this FileInfo.Length was made, but what's strange is that the same exception still got raised. I don't the problem had anything to do with those attributes, though, because when browsing drive C:\ there were files with the same attributes, but didn't raise an exception.
So I fired up SharpDevelop, started a new solution and copied the code into it, and then compiled the solution with Mono, and still got the same result. I tried the program in openSUSE 10.2 with Mono, too, somehow there were different exceptions, probably because I didn't log in as root, and didn't have enough privilege to access those directories/files.
Could anyone shed me some light on this? I've attached the solution here: http://download.yousendit.com/60C0C5630B95DBAC, in case anyone's interested in reproducing the bug.Greetings,- RednaxelaFX
Connect to the next generation of MSN Messenger 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20071002/4fda96db/attachment.html 

More information about the Mono-list mailing list