Skip to content

ファイルプロパティを格納するように修正#16

Merged
ulxsth merged 1 commit intomainfrom
ulxsth/append-index
Mar 27, 2025
Merged

ファイルプロパティを格納するように修正#16
ulxsth merged 1 commit intomainfrom
ulxsth/append-index

Conversation

@ulxsth
Copy link
Contributor

@ulxsth ulxsth commented Mar 27, 2025

Details

#14 で懸念点として挙げていた、ctime ~ ino あたりの情報をファイルから取得する処理を実装した。
fs の statSync でファイル情報を読みこんでいる。

 const fileStat = fs.statSync(filePath);
  const entry: GitIndexEntry = {
    ctime: { 
      seconds: Math.floor(fileStat.ctimeMs / 1000), 
      nanoseconds: (fileStat.ctimeMs % 1000) * 1e6 
    },
    mtime: { 
      seconds: Math.floor(fileStat.mtimeMs / 1000), 
      nanoseconds: (fileStat.mtimeMs % 1000) * 1e6 
    },
    dev: fileStat.dev,
    ino: fileStat.ino,

@ulxsth ulxsth merged commit 4ec047f into main Mar 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant