Home→Forums→MonoBrick Communication Library→Problems with Brick.FileSystem commands
Tagged: FileSystem
- This topic has 2 replies, 2 voices, and was last updated 8 years, 11 months ago by LittleBytesOfPi Corvallis, Oregon.
-
AuthorPosts
-
October 24, 2015 at 19:13 #5529
LittleBytesOfPi Corvallis, OregonParticipantThank you for this awesome code you have shared. I am using it to build a C# program and teach the kids a bit about programming and robotics.
Just about everything works great for me, except one thing. I can not get the file system commands to work. It ‘sort of’ works, but it does not get all the files on the system. It seems to find all the sub directories just fine, but it fails to properly get some or all of the files from each sub directory.
I have tried two approaches: the Brick.Filesystem.GetFolderStructure function and writing my own recursive function using a call to Brick.FileSystem.GetFolderInfo( ). Neither one works without some defects?
Also, of the files I do get, I am able to send command to start only one program; I can start the Demo.rpf that comes as the default program. However, my own programs (*.rbf) files do not play.
Does anyone have advice about possible problems and solutions with using file system commands?
Thank you
GB
November 15, 2015 at 15:18 #5546
urbanskurkParticipantAre there any spaces in the filenames that don’t work? Eg. ‘My program.rbf’ as opposed to ‘Myprogram.rbf’?
I myself can’t seem to get the the Filesystem commands to recognize neither Name, Type or Path on files with spaces in them.. Or rather, it gets the filename correct, up until the first space. Type is ‘Unknown’, because it never gets to the .rbf part and path is wrong because of the incomplete file name.
December 23, 2015 at 07:23 #5556
LittleBytesOfPi Corvallis, OregonParticipantubranskurk
Thank you for your suggestion about spaces in file names. There were no spaces in my program names, but the sound files had spaces in them. I removed spaces, and things got better, but I still have problems using file system commands.
I have set some breakpoints and watched the code. It appears that the string response is cut off. I searched around the code and noticed that certain read buffers have hard coded max size, maybe these buffers are not large enough.
Also, I get different results when using USB or bluetooth to the brick. Neither method works 100%.
To isolate the behavior from my implementation of the code, I put together a simple console app that just queries files (as per demo on this website). This gives same incomplete results when querying the file list
I will keep digging, if anyone else has file system problems or knows how to fix this, your input is appreciated.
Thank You
-
AuthorPosts
You must be logged in to reply to this topic.
Follow