views:

79

answers:

2

also, how would you build that structure from scratch. What is the fastest way to get the source code of the ls command in linux? Thanks.

+1  A: 

Download coreutils from gnu: http://ftp.gnu.org/gnu/coreutils/

ls is in there.

edit: I have no idea about the windows structure you're asking about, but if you're asking for the source to 'ls' I guess you're trying to read directories. Look at the man page for opendir and readdir, and also, scandir. And, to find out about the files you get from those, see the man page for stat in section 2 of the man.

smcameron
the struct i was asking about is here: http://msdn.microsoft.com/en-us/library/aa365740(VS.85).aspxstat is probably close enough for my purposes. http://linux.die.net/man/2/statThanks
Naveen
+1  A: 

The actual layout of the WIN32_FIND_DATA structure is on MSDN, if you are indeed interested in building it from scratch. Otherwise, @smcameron is right about the coreutils link for ls.

It's not Linux, but you can check out the OpenSolaris source for ls or the NetBSD ls.c online.

Mark Rushakoff