Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
sensboston
Old
(Last edited by sensboston; 1st March 2012 at 12:45 PM.)
#1  
Recognized Developer - OP
Thanks Meter 321
Posts: 1,250
Join Date: Nov 2009
Location: Boston, MA

 
DONATE TO ME
Default ISETool.exe bug

Today I found very annoying and strange bug (or, may be, MS call it "feature" ). Seems like directories on isf can hold 1024 files only...
Try code below:

Code:
Random rnd = new Random();
using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
{
      byte[] data = new byte[1024];
      isf.CreateDirectory("test");
      for (int i=0; i<1025; i++)
      {
          string fileName = "test\\" + i.ToString("D4") + ".bin";
          using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream(fileName, FileMode.Create, isf))
          {
               rnd.NextBytes(data);
               fs.Write(data, 0, data.Length);
          }
      }
}
After loop completed, resulting directory "test" will be empty! But change i<1024 and you'll get all yours 1024 files...

Tested on emulator and HTC Surround, same results. Can't find any documentation about this limitation... Shame on you, MS!

Update: another strange behavior ('cause of this bug) - if you already have 1024 files and try to add one more, the whole directory content is "magically" disappear But exception isn't thrown...
 
Dbeattie
Old
#2  
Member
Thanks Meter 8
Posts: 51
Join Date: Feb 2012
Location: Lincoln, NE
Interesting, I'll try it as well. This would be lame to have to work around.
 
sensboston
Old
#3  
Recognized Developer - OP
Thanks Meter 321
Posts: 1,250
Join Date: Nov 2009
Location: Boston, MA

 
DONATE TO ME
Quote:
Originally Posted by Dbeattie View Post
Interesting, I'll try it as well.
Yes, please, confirm...
 
Dbeattie
Old
#4  
Member
Thanks Meter 8
Posts: 51
Join Date: Feb 2012
Location: Lincoln, NE
I can't test this at the moment but I know I write well over 1000 files to /shared/media so I'm curious to tet this.
 
Nudua
Old
#5  
Senior Member
Thanks Meter 97
Posts: 290
Join Date: Mar 2011

 
DONATE TO ME
Quote:
Originally Posted by sensboston View Post
Yes, please, confirm...
Hey just tried it out, wrote 2k items to a folder called "Data".

While it didn't show up in the Windows Phone Power tools, the file does exist in the folder itself.

bool success = storage.FileExists(Path.Combine("data", "1999"));

So it's either a problem with the WPConnect api or with the power tools, haven't tried the command line tool.
 
sensboston
Old
#6  
Recognized Developer - OP
Thanks Meter 321
Posts: 1,250
Join Date: Nov 2009
Location: Boston, MA

 
DONATE TO ME
Yep, fortunately you are right, it's a ISETool.exe (or drivers) bug, not a WP7 ISF.
 
Casey_boy
Old
#7  
Casey_boy's Avatar
Recognized Developer
Thanks Meter 50
Posts: 456
Join Date: Feb 2010
Quote:
Originally Posted by sensboston View Post
Yep, fortunately you are right, it's a ISETool.exe (or drivers) bug, not a WP7 ISF.
Could you therefore edit the title of the thread please?

Thanks.

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Auto Test Your Android Apps with Robotium

You’ve just finished coding your very first app, but before you release it to the wild, you … more

Open Source CPU Info App for Windows

So you’re playing with your shiny new Windows 8 tablet PC, when one of your like-minded geeky … more

Guide to Using Adobe Air on Android

When writing an app with performance in mind, you most likely want to write it native code using the … more