Closing Files

E

E Tepp

Hi,

I have a program that opens a file for writing at one part, closes it
and then opens it again later for read. Although it works 99% of the
time, once in a while the file does not close correctly, at least I
think this is the problem.
The next time it reads the file it read in words with space between
each letter. For example "Hello" in the file will be read as "H e l l
o". Even on reboot the file remains open. When I delete the file and
make a now one the problem is fixed. Does anyone know how to prevent
this from happening, or at least fix it.

Thank You,
Elliott
 
M

Mike Schilling

E Tepp said:
Hi,

I have a program that opens a file for writing at one part, closes it
and then opens it again later for read. Although it works 99% of the
time, once in a while the file does not close correctly, at least I
think this is the problem.
The next time it reads the file it read in words with space between
each letter. For example "Hello" in the file will be read as "H e l l
o".
Spaces or nulls? If the latter, it sounds as if the encoding it's being
written in gets fouled up, and the program is writing 2-byte UTF-16
characters instead of single-byte UTF-8 or ASCII.
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top