# simplefork.py --
# demonstrates os.fork(), os.execl(), os.wait()

# import module os.
import os

# fork!
ret = os.fork()

# as child: list the files
if ret == 0:
    os.execl("/bin/ls")

# as parent: wait
else:
    print "Thats my child listing all the files"
    cpid, status = os.wait()
    print "Process id ", cpid
    print "child PID", ret
    print "Status ", status

########################################################################
