Author Topic: opendir/readdir in native SDK now working!  (Read 2814 times)

clach04 (OP)

  • *
  • Posts: 256
opendir/readdir in native SDK now working!
« on: November 22, 2010, 05:33:09 am »
http://code.google.com/p/dingoo-sdk/source/detail?r=288 adds working opendir/readdir support to the native SDK. This may be useful for adding file browsing functionality to applications :-)

There is every chance there are bugs in it, so go "kick the tires/tyres" :-)

I'm hopeful that stat() http://linux.die.net/man/2/stat support can be added in a similar way, viz. wrap the fsys_findfirst() function with macros, etc. so file information such as type, time stamp, file size, etc. can be gleaned based on the filename.

Chris

Harteex

  • * Administrator
  • Posts: 709
    • Harteex Productions
Re: opendir/readdir in native SDK now working!
« Reply #1 on: November 22, 2010, 03:18:13 pm »
Great work :)

Just one thing about fsys.h in r286, it seems like we have a duplication of attribute defines now, for example:
FSYS_FIND_DIRECTORY 0x10
vs
FSYS_ATTR_DIR       0x10

Also the different values for FILE seems to have conflicting values.

clach04 (OP)

  • *
  • Posts: 256
Re: opendir/readdir in native SDK now working!
« Reply #2 on: November 22, 2010, 04:34:07 pm »
Great work :)

Just one thing about fsys.h in r286, it seems like we have a duplication of attribute defines now, for example:
FSYS_FIND_DIRECTORY 0x10
vs
FSYS_ATTR_DIR       0x10

Also the different values for FILE seems to have conflicting values.

Here are my diffs that I posted:

http://code.google.com/p/dingoo-sdk/source/diff?spec=svn288&r=286&format=side&path=/trunk/dingoo_sdk/include/dingoo/fsys.h&old_path=/trunk/dingoo_sdk/include/dingoo/fsys.h&old=265

FSYS_FIND_DIRECTORY is the input value/constant for find.
FSYS_ATTR_DIR is the mask to use with the result attribute. They happen to have the same value but I think they are distinctly different. FSYS_ATTR_DIR is a mask and can be "|" or "&" with other masks. It doesn't look like you can use FSYS_FIND_DIRECTORY  with bit operations, i.f. the find files functions do not return files and dirs when you pass in FSYS_FIND_FILE | FSYS_FIND_DIRECTORY.

This is all reverse engineered based on observations however I may have misinterpreted the results :) it would be nice if we had real docs from China Chip....

Chris

flatmush

  • *
  • Posts: 283
Re: opendir/readdir in native SDK now working!
« Reply #3 on: November 23, 2010, 09:57:55 pm »
There are some ucos/II source files on the ingenic site (or were) but Dingoo Digital provided a number of the functions themselves. I have a feeling that these functions are not part of the ingenic ucos but it'd be worth a quick look and a search since the source is clearly what the current Dingoo OS is (heavily) based off.

 

Post a new topic
Post a new topic