Detecting EOF


Closed Thread
Results 1 to 3 of 3

Thread: Detecting EOF

  1. #1

    Default Detecting EOF

    Hello PIC users friends,

    I have an application which reads a .txt file from a USB storage device.
    With Darrel’s help I solved all my problems on dealing with “Big Numbers” (I promisse Darrel this is the last time you will see the label “big_number” or anything similar to it) to extend the “reach” of an old device to higher number of records (I don’t know how to post a link, but look under “Code examples”/ "Retiving 32bit Multiply Result").

    I’m slowly stepping into this magic world of PicBasicPro, my background is not in programming and simple things for the experienced programmer are new to me.
    I did few searches but came empty.
    I am willing to do the work it takes but I’m a little lost when I’m faced with unfamiliar territory. This is one of them.

    I’m planning on working on replacing this “temporary patch” with a newer version and for this I need a way to detect the EOF of a .txt file.
    The questions are:

    1- If I read the .txt data file, with a PIC, byte by byte and look at each byte, when can I say I reached the EOF?
    2- What is the EOF, a special character or a series of characters?
    3- Does anyone know of a way to do it or point me to a place which addresses this problem?

    Regards,

    Nick

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    The EOF character in TXT files used to be CTRL-Z or 1A(Hex) since the days of CP/M DOS. Nowadays, I don't think this is true. However, you could check for the $1a character in PBP if it is there.

    JF

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thank you Jerson.
    I will try it and get back with the results.

    Regards,

    Nick

Similar Threads

  1. Detecting a pulse
    By Dennis in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 28th February 2010, 13:12
  2. Best choice for detecting water?
    By ShortBus in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 13th October 2009, 20:18
  3. Dialer detecting end user hookup
    By lerameur in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 3rd September 2008, 16:45
  4. Automatically detecting a USB device
    By Demon in forum USB
    Replies: 9
    Last Post: - 26th July 2006, 01:41
  5. Detecting AC current
    By rhino in forum Off Topic
    Replies: 8
    Last Post: - 8th July 2005, 21:31

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts