Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

telno

Member Since 24 Nov 2011
Offline Last Active Jul 13 2014 04:35 AM
-----

Posts I've Made

In Topic: Opening same file for read multiple times?

04 April 2013 - 11:49 PM

Good point.  I just found this via Google, and when the code fix worked successfully I knew it was still relevant to the official source.

 

 

Would love to hear from someone about a fix for this issue.


In Topic: Opening same file for read multiple times?

04 April 2013 - 03:48 PM

I got this working after looking at the Netduino source for: NetduinoGoFirmware / Framework / Core / Native_IO / FileSystemManager.cs

 

The problem seems to be this section:

 

if ((share != FileShareReadWrite) ||((current.Share & access) != access)){throw new IOException("", (int)IOException.IOExceptionErrorCode.UnauthorizedAccess);}

 

First of all, this code means that [color=#ff0000;]only ReadWrite shared access is supported[/color].  This isn't documented anywhere I could find.

 

Second, the code creates a dependency on those enumeration values being the same (and never changing).  Bad, coupling.

 

 

To work around the issue, update the file access and share permissions to ReadWrite:

 

string fileName = @"SDtest.log";var writeStream = File.Open(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);var readStream = File.Open(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);

In Topic: Opening same file for read multiple times?

03 April 2013 - 08:20 PM

I'm experiencing the same problem. I get an IO exception on the second FileStream.  In my case, the first stream is a writer (log writer), and the second is a reader (log reader).

 

 

 

 

string fileName = @"SDtest.log";var writeStream = File.Open(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);// this line will fail with IOException (ErrorCode=UnauthorizedAccess)var readStream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); 

 

 
 

In Topic: Netduino Plus 2 Problems

14 November 2012 - 04:45 AM

Same problem here. DHCP is successfully grabbing an IP but it's showing as MAC 00:04:A3:00:00:00 on my router instead of the actual MAC on the sticker (5C:86:*).

In Topic: Looking for TinyBooterDecompressor.bin

14 November 2012 - 01:53 AM

I just ran into the same roadblock when trying to follow the wiki to upload TinyBooterDecompressor. I just updated that wiki to point to the forum .zip file download. Even better, please post the latest firmwares on the downloads page so all downloads are available there so we don't have to find some of them embedded in the forums :) Thanks!

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.