Skip to main content
added 108 characters in body
Source Link
cshu
  • 111
  • 3

File is a widely used concept about entries in a filesystem.

Usually it includes Directory, Regular File (hard link), and Symbolic Link (soft link). And may even include device and socket.

My question is simply what is the difference of a file and a hard link ? Hard link is pointing to an inode, so what is a file ? Inode entry itself ? Or an Inode with a hard link ?

Let's say, I create a file with touch, then an Inode entry is created in the Inode Table. And I create a hard link, which has the same Inode number with the file. So did I create a new file ? Or the file is just defined as an Inode ?

Since even symbolic link is usually counted as file, a hard link itself can also be counted as a file. You can say it's a file regardless of whether it's a hard or soft link.

The concept is a bit ambiguous so it's also okay to say that an inode entry is a file, though you may actually want to refer to the data.

If you are a C++ or Java programmer you might want to read about std::filesystem::file_type, java.io.File, and java.nio.file.Files.

Details about differences between hard link and soft link can be found in the link in infixed's comment.

File is a widely used concept about entries in a filesystem.

Usually it includes Directory, Regular File (hard link), and Symbolic Link (soft link). And may even include device and socket.

My question is simply what is the difference of a file and a hard link ? Hard link is pointing to an inode, so what is a file ? Inode entry itself ? Or an Inode with a hard link ?

Let's say, I create a file with touch, then an Inode entry is created in the Inode Table. And I create a hard link, which has the same Inode number with the file. So did I create a new file ? Or the file is just defined as an Inode ?

Since even symbolic link is usually counted as file, a hard link itself can also be counted as a file. You can say it's a file regardless of whether it's a hard or soft link.

The concept is a bit ambiguous so it's also okay to say that an inode entry is a file, though you may actually want to refer to the data.

Details about differences between hard link and soft link can be found in the link in infixed's comment.

File is a widely used concept about entries in a filesystem.

Usually it includes Directory, Regular File (hard link), and Symbolic Link (soft link). And may even include device and socket.

My question is simply what is the difference of a file and a hard link ? Hard link is pointing to an inode, so what is a file ? Inode entry itself ? Or an Inode with a hard link ?

Let's say, I create a file with touch, then an Inode entry is created in the Inode Table. And I create a hard link, which has the same Inode number with the file. So did I create a new file ? Or the file is just defined as an Inode ?

Since even symbolic link is usually counted as file, a hard link itself can also be counted as a file. You can say it's a file regardless of whether it's a hard or soft link.

The concept is a bit ambiguous so it's also okay to say that an inode entry is a file, though you may actually want to refer to the data.

If you are a C++ or Java programmer you might want to read about std::filesystem::file_type, java.io.File, and java.nio.file.Files.

Details about differences between hard link and soft link can be found in the link in infixed's comment.

added 108 characters in body
Source Link
cshu
  • 111
  • 3

File is a widely used concept about entries in a filesystem.

Usually it includes Directory, Regular File (hard link), and Symbolic Link (soft link). And may even include device and socket.

My question is simply what is the difference of a file and a hard link ? Hard link is pointing to an inode, so what is a file ? Inode entry itself ? Or an Inode with a hard link ?

Let's say, I create a file with touch, then an Inode entry is created in the Inode Table. And I create a hard link, which has the same Inode number with the file. So did I create a new file ? Or the file is just defined as an Inode ?

SincSince even symbolic link is usually counted as file, a hard link itself can also be counted as a file. You can say it's a file regardless of whether it's a hard or soft link.

The concept is a bit ambiguous so it's also okay to say that an inode entry is a file, though you may actually want to refer to the data.

Details about differences between hard link and soft link can be found in the link in infixed's comment.

File is a widely used concept about entries in a filesystem.

Usually it includes Directory, Regular File (hard link), and Symbolic Link (soft link). And may even include device and socket.

My question is simply what is the difference of a file and a hard link ? Hard link is pointing to an inode, so what is a file ? Inode entry itself ? Or an Inode with a hard link ?

Let's say, I create a file with touch, then an Inode entry is created in the Inode Table. And I create a hard link, which has the same Inode number with the file. So did I create a new file ? Or the file is just defined as an Inode ?

Sinc even symbolic link is usually counted as file, a hard link itself can also be counted as a file. You can say it's a file regardless of whether it's a hard or soft link.

The concept is a bit ambiguous so it's also okay to say that an inode entry is a file, though you may actually want to refer to the data.

File is a widely used concept about entries in a filesystem.

Usually it includes Directory, Regular File (hard link), and Symbolic Link (soft link). And may even include device and socket.

My question is simply what is the difference of a file and a hard link ? Hard link is pointing to an inode, so what is a file ? Inode entry itself ? Or an Inode with a hard link ?

Let's say, I create a file with touch, then an Inode entry is created in the Inode Table. And I create a hard link, which has the same Inode number with the file. So did I create a new file ? Or the file is just defined as an Inode ?

Since even symbolic link is usually counted as file, a hard link itself can also be counted as a file. You can say it's a file regardless of whether it's a hard or soft link.

The concept is a bit ambiguous so it's also okay to say that an inode entry is a file, though you may actually want to refer to the data.

Details about differences between hard link and soft link can be found in the link in infixed's comment.

Source Link
cshu
  • 111
  • 3

File is a widely used concept about entries in a filesystem.

Usually it includes Directory, Regular File (hard link), and Symbolic Link (soft link). And may even include device and socket.

My question is simply what is the difference of a file and a hard link ? Hard link is pointing to an inode, so what is a file ? Inode entry itself ? Or an Inode with a hard link ?

Let's say, I create a file with touch, then an Inode entry is created in the Inode Table. And I create a hard link, which has the same Inode number with the file. So did I create a new file ? Or the file is just defined as an Inode ?

Sinc even symbolic link is usually counted as file, a hard link itself can also be counted as a file. You can say it's a file regardless of whether it's a hard or soft link.

The concept is a bit ambiguous so it's also okay to say that an inode entry is a file, though you may actually want to refer to the data.