执行'mv A B':'inode'会改变吗? [英] Executing 'mv A B': Will the 'inode' be changed?

查看:29
本文介绍了执行'mv A B':'inode'会改变吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们执行一个命令:

If we execute a command:

mv A B

那么文件A的inode中的字段会发生什么?会变吗?

then what will happen to the fields in the inode of file A? Will it change?

我不认为它应该通过更改文件名来更改,但我不确定.

I don't think that it should change just by changing the name of the file, but I'm not sure.

推荐答案

这至少部分取决于 A 和 B 是什么.如果您在文件系统之间移动,那么 inode 几乎肯定会有所不同.

It depends at least partially on what A and B are. If you're moving between file systems, the inode will almost certainly be different.

简单地重命名同一系统上的文件更有可能保持相同的 inode,因为 inode 属于数据而不是目录条目,并且效率会导致这种设计.但是,这取决于文件系统,并且不受标准的强制要求.

Simply renaming the file on the same system is more likely to keep the same inode simply because the inode belongs to the data rather than the directory entry and efficiency would lead to that design. However, it depends on the file system and is in no way mandated by standards.

例如,可能有一个带有 inode 概念的版本控制文件系统,它会为您提供一个新的 inode,因为它想要跟踪名称更改.

For example, there may be a versioning file system with the inode concept that gives you a new inode because it wants to track the name change.

这篇关于执行'mv A B':'inode'会改变吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆