Skip to main content

Posts

Open a file descriptor, not only a file, in Python

I think most of Python programmers are quite familar with using the builtin method open to open a file, which I mean a real file on disk, a stored file, like a txt file. But actually, we can also use the same open function to open a file descriptor. Normally, this is a better way to read and write files than by directly using os.read and os.write, which are both low level interfaces. I'll share my knowledge about open a file descriptor in this blog post.  What is file descriptor? Technically speaking, a file descriptor is just a non-negative number which represents a I/O resource within a process, such as a disk file, a pipe, a socket or a device. We often use fd as a short hand name. Everything is a file in Linux! The most famous file descriptors for each process are 1, 2 and 3, which represent stdin, stdout and stderr respectively. They are created automatically for each process by operation system.  We can check these file descriptors in...

The start of the Internet, ARPANET in 1973 and 1977

I believe that these two early maps of ARPANET in 1973  and 1977 respectively are very valuable. As a software engineer, my early career was dedicated in a project for developing TCP/IP stack. There is a undescribable intimate emotion every time when I look at these pictures. :)  ARPANET in 1973 ARPANET Logical Map in May 1973 ARPANET in 1977 4 years late since 1973, no big change. At early stage of the Internet, everything evolved at snail speed, not like today's rocket speed. ARPANET Logical Map in Mar 1977 ARPANET stands for Advanced Research Project Agency Network , which is the first wide-range packet switching network. Now, Internet basically controls human race! No one can even imagin life without connection to the Internet any more. It is nearly impossble. Human kind has no way back definitely.   Design Purpose of ARPANET Even though the ARPANET project was established by DARPA (Defense Advanced Research Project Agency)...