Shop OBEX P1 Docs P2 Docs Learn Events
S35390A_SD-MMC_FatEngine Help - change dir and list files — Parallax Forums

S35390A_SD-MMC_FatEngine Help - change dir and list files

Mike GMike G Posts: 2,702
edited 2011-06-11 18:24 in Propeller 1
I'm moving from Kye's FAT 2.0 to the new S35390A_SD-MMC_FatEngine. I invoke the changeDirectory method then listEntries("N") but keep getting the root directory listing. What is the proper syntax to change directory then list the files in the current working directory?

   pst.str(string(13, "CD Style> "))
   pst.str(SDCard.changeDirectory(string("style")))
   pst.char(13)

   repeat 10
    pst.str(string("SDCard.listEntries(N)> "))
    pst.str(SDCard.listEntries("N"))
    pst.char(13)

sdcardout.gif
589 x 386 - 12K

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-06-11 10:11
    Figures... I was messing with this for a while last night and this morning. Then I post - then I figure it out... I think anyway. I'm not sure why you have to invoke listEntries("W") first.

    W = Wrap
    N = Next
       pst.str(string(13, "CD Style> "))
       pst.str(SDCard.changeDirectory(string("style")))
       pst.char(13)
       pst.str(SDCard.listEntries("W"))
       repeat 10
        pst.str(string("SDCard.listEntries(N)> "))
        pst.str(SDCard.listEntries("N"))
        pst.char(13)
    
  • KyeKye Posts: 2,200
    edited 2011-06-11 18:24
    Unlike in the old driver the "listEntries" function now is not linked to the directory pointer shared by all other file system rountines. This allows for advanced features like "deleting all files ina direcotry" or "opening all files in a directory".

    Before you couldn't do that because the file system pointers would reset themselves after executing a different file system function.

    I think it's a small price to pay for more functionality.

    Thanks,
Sign In or Register to comment.