Text file I/O

G

Guest

From a vb.net app running on a win ce handheld scanner, can I do a keyed read
and a write to a text file? I am currently reading the File I/O chapter of
my book, it looks like I can with a reader, but I can't tell if I can supply
some type of key instead of reading every record in byte by byte and
inspecting it.

Also, if the power runs out on the device, will I lose the contents of the
file?

Thanks,
Steve
 
P

Paul G. Tobey [eMVP]

We can't give complete answers to your questions without knowing what device
you're talking about and where you're storing the file in the filesystem (on
some devices, some portions of the filesystem are volatile and some are not,
on other devices the entire filesystem is volatile, while on still others,
everything is non-volatile).

In general, the default readers aren't going to interpret your files as some
sort of database where you do lookups. You could create a file format and
your own reader subclass to do that.

Paul T.
 
G

Guest

Paul,
The device is a PSC Falcon 4220 PDA-type scanner. It runs Win CE .NET. I
am using VS.NET 2003 to code VB.NET for the application. I don't know where
the file would reside in the file structure yet as I don't know what is
visible to the devices.
I do understand from your response that the default readers probably will
read one record at a time in sequential order, and I will have to inspect
every byte or string, and not be able to do a keyed look up of any type.

Thanks,
Steve
 
P

Paul G. Tobey [eMVP]

OK. I don't know enough about that device to tell you where, if anywhere,
there is non-volatile filesystem space to be found, but that should be in
the manual. On our devices, there's a folder, \Flash, which is
non-volatile, while the rest of the filesystem (if there are no storage
cards installed), is volatile.

Yes, the readers are just for reading data. Unless they knew what the
format of the data was or what a "key" meant in your scenario, they wouldn't
be able to do anything with it (and you'd probably have to use a matching
Writer to write the file so that you'd be sure it works).

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top