|
|
19 Jun 2008 08:04:12 am |
Readdir |
|
|
http://www-128.ibm.com/developerworks/aix/library/au-unix-readdir.html
The dirent.h functions, opendir(), readdir(), and closedir(), are just what you need. Using them is very similar to the open/read/close idiom you're probably used to using with files, with one exception: the readdir() function returns a pointer to a special structure (of type struct dirent) for each directory entry
dir = opendir( "some/path/name" )
entry = readdir( dir )
while entry is not NULL:
do_something_with( entry )
entry = readdir( dir )
closedir( dir )
int readdir_r(DIR *, struct dirent *, struct dirent **);
struct dirent {
ino_t d_ino; /* file number of entry */
__uint16_t d_reclen; /* length of this record */
__uint8_t d_type; /* file type, see below */
__uint8_t d_namlen; /* length of string in d_name */
char d_name[__DARWIN_MAXNAMLEN + 1]; /* name must be no longer than this */
};
file type is list below,
DT_UNKNOWN
The file type is unknown.
DT_REG
This is a regular file.
DT_DIR
This is a directory.
DT_FIFO
This is a named pipe, or FIFO.
DT_SOCK
This is a Unix domain socket.
DT_CHR
This is a character device.
DT_BLK
This is a block device. |
|
| |
Category : About
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
03 Jun 2008 02:47:04 am |
Winchain installation |
|
|
用WinChain来装Iphone toolchain也是挺省力的事情,下载pretoolchain完后,解压,运行WinChain.1.1,觉得它就是把pretoolchain rename成Cygwin, 然后下载安装一下cgywin,装default的pack.
同样的过程在公司安装就是无法编译,最后发现\usr\local\arm-apple-darwin\include\stdint.h这个link不对了,用\usr\local\arm-apple-darwin\include\gcc\darwin\4.0替换掉. |
|
| |
Category : IPhone
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
1 |
|