2011年11月22日 星期二

Network Programming Homework

最近發現 記憶力常常衰退 常常忘記之前在程式上犯的錯誤

因此想寫在Blogger上 以供以後我上來查詢 希望blogger 永在

1. FIFO - Both writer & reader got to open the fifo, otherwise it were stuck!!!

2. Share Memory - It's not very difficult. But it has some problem with initialization. I not very sure, I think that because share memory is static space, so when you get the pointer that point at first space of share memory,  you just can enforce the type of pointer (void *) convert to type of pointer you want. So you got write some function like init();

3. chdir(const char[]) - very useful function.

                  Example: chdir("./bin");

                  So when you type command 'ls', it will list the files of  'bin' directory.

4. setenv(const char[], const char[], bool overwrite)

                  Example: setenv("PATH", ".:bin", 1);

                  It means the environment variable "PATH" to be set the value of  ".:bin", and overwrite the original
                  value.

5. getenv(const char[])

                  Example: getenv("PATH");

                  just example.......

沒有留言:

張貼留言