Jamie
Jamie

Reputation: 4960

WP7 Isolated Storage

I'm trying to grab my files from isolated storage but unfortunatly it is pulling in all the files not just the specified ones from the pattern.

I'm using:

foreach (string fileName in storage.GetFileNames("*.item"))

Is this a known bug or am I just doing something wrong?

PS. The use of wildcards is essential

Any help very much apprieciated,

Thanks!

Upvotes: 0

Views: 1065

Answers (5)

Styff
Styff

Reputation: 113

This API bug has been fixed in the release of the Windows Phone 7.1 SDK (Otherwise known as the "Mango" release).

Your code will work fine now.

Upvotes: 0

Mick N
Mick N

Reputation: 14882

This is a known issue. You'll need to either structure your files into folders if you want to limit what's retrieved or test/filter the filenames before loading them.

Upvotes: 1

indyfromoz
indyfromoz

Reputation: 3763

There is a IsolatedStorage search pattern bug in the final SDK release. Have a look at this post - http://blogs.compactframework.de/Peter.Nowak/2010/09/18/WP7+Final+SDK+Bug+IsolatedStorageFile+And+Ldquosearchpatternrdquo+And+A+Fix.aspx

HTH, indyfromoz

Upvotes: 1

James Kovacs
James Kovacs

Reputation: 11661

Looks like a bug in the CTP/Beta versions of IsolatedStorageFile.GetFileNames(string pattern)...

http://blogs.compactframework.de/Peter.Nowak/Trackback.aspx?guid=4d8d9b73-619f-43c7-bf6c-12429327206b

Upvotes: 0

Bashir Magomedov
Bashir Magomedov

Reputation: 2881

I'm not sure why it is not working. But you can try this one as well:

storage.GetFileNames().Select(fileName => fileName.EndsWith("item"));

Upvotes: 2

Related Questions