D
Drak
I just bought a new Axim x50v and tested my application on it - spent
some time to fix the disappearing toolbar icons and other minor
problems. However I can not find any information regarding the
following problem:
1. I open a file located on a storage card using System.IO.FileStream.
2. Remove the storage card
3. Any operation on the stream (e.g. Seek or ReadByte) will hang the
program - the program never gets the control after calling Seek or
ReadByte
On my older (2002) device the above will throw an exception (which is
the expected behavior).
Here is the sample code I run (just adjust the path - use any file you
want):
try
{
System.IO.FileStream s =
new System.IO.FileStream(@"\SD Card\Test.tst",
System.IO.FileMode.Open,
System.IO.FileAccess.Read, System.IO.FileShare.Read, 15000,
false);
MessageBox.Show("remove the card now");
s.ReadByte(); //or call -> s.Seek(1, System.IO.SeekOrigin.Begin);
MessageBox.Show("never comes here");
}
catch
{
MessageBox.Show("never comes here either");
}
some time to fix the disappearing toolbar icons and other minor
problems. However I can not find any information regarding the
following problem:
1. I open a file located on a storage card using System.IO.FileStream.
2. Remove the storage card
3. Any operation on the stream (e.g. Seek or ReadByte) will hang the
program - the program never gets the control after calling Seek or
ReadByte
On my older (2002) device the above will throw an exception (which is
the expected behavior).
Here is the sample code I run (just adjust the path - use any file you
want):
try
{
System.IO.FileStream s =
new System.IO.FileStream(@"\SD Card\Test.tst",
System.IO.FileMode.Open,
System.IO.FileAccess.Read, System.IO.FileShare.Read, 15000,
false);
MessageBox.Show("remove the card now");
s.ReadByte(); //or call -> s.Seek(1, System.IO.SeekOrigin.Begin);
MessageBox.Show("never comes here");
}
catch
{
MessageBox.Show("never comes here either");
}