Skip to content

Commit

Permalink
Fix to match latest FileSystem syntax (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
muenchris authored Jul 29, 2024
1 parent ba328d1 commit d17a734
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ public static void Main()
Debug.WriteLine("+++++ System.IO.FileSystem examples +++++");

Debug.WriteLine("+++++ Creating a sample file +++++");
File.Create(sampleFilePath);
var fs=File.Create(sampleFilePath);

byte[] sampleBuffer = Encoding.UTF8.GetBytes(sampleText);

FileStream fs = new FileStream(sampleFilePath, FileMode.Open, FileAccess.ReadWrite);
fs.Write(sampleBuffer, 0, sampleBuffer.Length);

if(fs.CanSeek)
Expand Down
9 changes: 5 additions & 4 deletions samples/System.IO.FileSystem/MountExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics;
using System.Threading;
using nanoFramework.System.IO.FileSystem;
using nanoFramework.System.IO;

namespace MountExample
{
Expand Down Expand Up @@ -84,14 +85,14 @@ static bool MountMyCard()
// This only works for SD card adapter that include card detect pin tied to GPIO pin
// If no Card Detect pin then events not required

private static void StorageEventManager_RemovableDeviceRemoved(object sender, RemovableDeviceEventArgs e)
private static void StorageEventManager_RemovableDeviceRemoved(object sender, RemovableDriveEventArgs e)
{
Debug.WriteLine($"Card removed - Event:{e.Event} Path:{e.Path}");
Debug.WriteLine($"Card removed - Event:{e.Event} Path:{e.Drive}");
}

private static void StorageEventManager_RemovableDeviceInserted(object sender, RemovableDeviceEventArgs e)
private static void StorageEventManager_RemovableDeviceInserted(object sender, RemovableDriveEventArgs e)
{
Debug.WriteLine($"Card inserted - Event:{e.Event} Path:{e.Path}");
Debug.WriteLine($"Card inserted - Event:{e.Event} Path:{e.Drive}");

// Card just inserted lets try to mount it
MountMyCard();
Expand Down

0 comments on commit d17a734

Please sign in to comment.