[Ilugc] strtok

  • From: spsenthil@xxxxxxxxxxxxx (spsenthil)
  • Date: Tue Jul 20 12:56:20 2004



Hi..

    By using strtok(), if I read the /etc/passwd file with delimiter
":",
    I am not getting expected result.  For example, if a line contains

    rpm:x:37:37::/var/lib/rpm:/bin/bash

    the '::' is read at once instead of twice.
    Is there any other way to read data with delimiter ?
        U can try it with strsep( )  with similar type of arguments...
      check out man pages for exact format... but i dont find any difference
in these functions...

     let me know if there is any..

cheers!!!
senthil s.p.



Other related posts: