Closing Files

Discussion in 'Java' started by E Tepp, Feb 2, 2004.

  1. E Tepp

    E Tepp Guest

    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
    E Tepp, Feb 2, 2004
    #1
    1. Advertising

  2. "E Tepp" <> wrote in message
    news:...
    > 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.
    Mike Schilling, Feb 2, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henrik Holm

    Closing files

    Henrik Holm, Nov 29, 2004, in forum: Python
    Replies:
    6
    Views:
    459
    =?iso-8859-1?Q?Fran=E7ois?= Pinard
    Nov 30, 2004
  2. Sandra-24

    Opening files without closing them

    Sandra-24, Mar 5, 2006, in forum: Python
    Replies:
    15
    Views:
    525
    3c273
    Mar 8, 2006
  3. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    649
    Thomas Hansen
    Feb 15, 2007
  4. Matt
    Replies:
    35
    Views:
    1,373
    J. Davidson
    Nov 21, 2008
  5. thomas
    Replies:
    0
    Views:
    226
    thomas
    Oct 23, 2003
Loading...

Share This Page