Post Reply

ISETool.exe bug

OP sensboston

24th February 2012, 10:34 PM   |  #1  
OP Recognized Developer
Flag Boston, MA
Thanks Meter: 426
 
1,493 posts
Join Date:Joined: Nov 2009
Donate to Me
More
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...
Last edited by sensboston; 1st March 2012 at 12:45 PM.
24th February 2012, 10:54 PM   |  #2  
Member
Flag Lincoln, NE
Thanks Meter: 8
 
51 posts
Join Date:Joined: Feb 2012
More
Interesting, I'll try it as well. This would be lame to have to work around.
25th February 2012, 12:53 AM   |  #3  
OP Recognized Developer
Flag Boston, MA
Thanks Meter: 426
 
1,493 posts
Join Date:Joined: Nov 2009
Donate to Me
More
Quote:
Originally Posted by Dbeattie

Interesting, I'll try it as well.

Yes, please, confirm...
25th February 2012, 02:12 AM   |  #4  
Member
Flag Lincoln, NE
Thanks Meter: 8
 
51 posts
Join Date:Joined: Feb 2012
More
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.
26th February 2012, 04:45 PM   |  #5  
Senior Member
Thanks Meter: 97
 
290 posts
Join Date:Joined: Mar 2011
Donate to Me
Quote:
Originally Posted by sensboston

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.
27th February 2012, 02:47 PM   |  #6  
OP Recognized Developer
Flag Boston, MA
Thanks Meter: 426
 
1,493 posts
Join Date:Joined: Nov 2009
Donate to Me
More
Yep, fortunately you are right, it's a ISETool.exe (or drivers) bug, not a WP7 ISF.
1st March 2012, 08:58 AM   |  #7  
Casey_boy's Avatar
Retired Recognized Developer
Thanks Meter: 56
 
456 posts
Join Date:Joined: Feb 2010
More
Quote:
Originally Posted by sensboston

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 Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes