You are not logged in.

#1 2006-10-17 16:08:35

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

[solved] Learning from the sources...

I'd like learning some unix/linux C programming tricks from the sources of the smaller but extra useful programs.

How can I download and browse the source of programs like 'ls', 'file', 'which'?
Be very verbose, I am a newbie of programming... :S


Thanks a lot.

Offline

#2 2006-10-17 16:17:56

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [solved] Learning from the sources...

Install the cvsup package and execute "abs". This will download PKGBUILDs for all arch packages in the current and extra repositories. Then you choose a package, let's choose coreutils now:

cd /some/working/dir
cp -r /var/abs/base/coreutils .
cd coreutils
makepkg -o

Now the sources for coreutils package are in the src/coreutils-X.Y.Z subdirectory. You can do the same for any other arch package to get its sources.

Offline

#3 2006-10-17 16:55:21

bboozzoo
Member
From: Poland
Registered: 2006-08-01
Posts: 125

Re: [solved] Learning from the sources...

btw. coreutils sources really suck, the indentation used is really insane

Offline

#4 2006-10-17 22:38:22

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: [solved] Learning from the sources...

thanks a lot, I'll try soon.

Offline

#5 2006-10-18 12:45:02

liem
Member
Registered: 2006-04-29
Posts: 71
Website

Re: [solved] Learning from the sources...

Check out OpenBSDs CVS-tree. That's from where I'm learning.


Sebastian  A. Liem

Offline

Board footer

Powered by FluxBB