Link Counter
Most file systems that support hard links use reference counting. An integer value is stored with each physical data section. This integer represents the total number of links that have been created to point to the data. When a new link is created, this value is increased by one. When a link is removed, the value is decreased by one. If the link count becomes zero, the operating system usually automatically deallocates the data space of the file if no process has the file opened for access. The maintenance of this value assists users in preventing data loss. This is a simple method for the file system to track the use of a given area of storage, as zero values indicate free space and nonzero values indicate used space.
On POSIX-compliant operating systems, such as many Unix-variants, the reference count for a file or directory is returned by the stat or fstat system calls in the st_nlink field of struct stat.
Read more about this topic: Hard Link
Famous quotes containing the words link and/or counter:
“The lifelong process of caregiving, is the ultimate link between caregivers of all ages. You and I are not just in a phase we will outgrow. This is lifebirth, death, and everything in between.... The care continuum is the cycle of life turning full circle in each of our lives. And what we learn when we spoon-feed our babies will echo in our ears as we feed our parents. The point is not to be done. The point is to be ready to do again.”
—Paula C. Lowe (20th century)
“The technological landscape of the present day has enfranchised its own electoratesthe inhabitants of marketing zones in the consumer goods society, television audiences and news magazine readerships... vote with money at the cash counter rather than with the ballot paper at the polling booth.”
—J.G. (James Graham)