1

我正在做一个关于日志结构文件系统的项目,我正在做这个项目的中途,已经为普通文件和目录创建了 inode,现在我想处理符号链接。

这是我的 inode 的结构。

int8_t is_active;

/* inode no. of the file */
uint16_t inode_number;

/* the most up-to-date version id */
uint8_t latest_version_id;

/* Details about the direct block */
BlockInfo direct_block[4];

/* Details about the indirect block */
BlockInfo indirect_block;

/* The type, permissions, etc. */
unsigned long inode_mode;

/* The user id */
//unsigned short uid;

/* The group id */
//unsigned short gid;

/* The number of links to the inode */
unsigned short number_of_links;

/* The size of the file, in bytes.
 * If it is a directory file, this will contain the number of
 * immediate children in the directory.
 *
 * If it is a regular file, it will contain the actual file size*/
unsigned long int file_size;

/* The number of blocks used by the inode */
unsigned long number_of_blocks;

/* The creation time of the file */
struct timeval creation_time;

/* The modification time of the file */
struct timeval modification_time;

struct timeval access_time;

任何人都可以帮助我创建符号链接。

4

1 回答 1

0

符号链接是一个常规文件,其中包含指向目标的路径名。使用模式位使文件系统代码读取链接并在打开、创建、取消链接等时进行重定向。

于 2013-02-22T21:44:21.130 回答