windows如何決定兩個具有相同時間戳的檔案中哪一個更新?

當您有兩個具有相同時間戳的相同檔案時,Windows卻說其中一個檔案比另一個檔案新,這意味著什麼?怎麼會這樣?今天的超級使用者問答帖子幫助困惑的讀者解開了時間戳之謎。...

windows如何決定兩個具有相同時間戳的檔案中哪一個更新?

當您有兩個具有相同時間戳的相同檔案時,Windows卻說其中一個檔案比另一個檔案新,這意味著什麼?怎麼會這樣?今天的超級使用者問答帖子幫助困惑的讀者解開了時間戳之謎。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

問題

超級使用者讀者WBT想知道Windows如何決定兩個具有相同時間戳的檔案中哪一個更新:

When Windows displays a dialog like this with matching time stamps, how does it determine which of the two files is newer?

007Ys3FFgy1gpc076n3nhj30cy0dc74y

At first, I thought Windows was comparing the date created attribute and using the result of that comparison to label one or the other as newer. If a file was copied into a particular location, it may have the creation date of when the copy was made rather than the creation date of the original file. However, after reproducing it with another file, the result of which one is newer seems to be the opposite:

007Ys3FFgy1gpc077e8qwj30hd0br0uz

The result is the same whether copying or moving the file:

007Ys3FFgy1gpc0784q5oj30hd08swgx

And for background, the file in test2 is a previously made copy of the file in test1.

Windows如何決定兩個具有相同時間戳的檔案中哪一個更新?

答案

超級使用者貢獻者grawity為我們提供了答案:

Time stamps in the NTFS file system have a resolution of 100 nanoseconds (0.0000001 s). Even if the properties dialog shows the same rounded value, it could still be that the files were created within tenths of a second of each other.

Note: Most file systems measure times in μs or ns. FAT32 is a bit of a relic and rounds timestamps to two seconds.

Try one of the following methods to compare the full time stamps:

  • wmic datafile where name=”c:\\foo\\bar.txt” get lastmodified

Via PowerShell:

  • (Get-ChildItem c:\foo\bar.txt).LastWriteTime.ToString(“o”)

有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

圖片來源:WBT(超級使用者)

  • 發表於 2021-04-08 07:54
  • 閱讀 ( 29 )
  • 分類:網際網路

你可能感興趣的文章

使用以下技巧和技巧成為linux命令列高手

... 如何掌握linux命令列:最後的想法 ...

  • 發佈於 2021-03-12 10:19
  • 閲讀 ( 44 )

為什麼windows會自動儲存登錄檔?

你可能聽說過很多“登錄檔”,特別是在調整Windows功能和解決系統問題時。但如果你和大多數人一樣,你實際上並不知道登錄檔是什麼。 ...

  • 發佈於 2021-03-12 23:10
  • 閲讀 ( 33 )

在谷歌上搜索“按日期”的6種方法

...尋結果的頁面。但當你仔細篩選時,還有一個問題——你如何獲得最新的資訊? ...

  • 發佈於 2021-03-13 17:12
  • 閲讀 ( 58 )

7個免費的windows工具來自動執行重複的任務

...個目錄中的檔案。但是grep是一個命令列工具,它不適合Windows使用者。幸運的是,grepWin是一個GUI工具。 ...

  • 發佈於 2021-03-14 01:07
  • 閲讀 ( 56 )

如何在多個檔案中查詢和替換單詞

... 記事本++是一個免費的原始碼編輯器和Windows記事本的替代品。它是在GNU通用公共許可下發布的,這使它成為一個開源工具。 ...

  • 發佈於 2021-03-14 20:34
  • 閲讀 ( 54 )

windows備份和還原指南

... 本手冊將指導您完成在Windows10中設定和維護定期備份的過程。這些概念幾乎可以用於任何其他作業系統,儘管具體步驟可能略有不同。 ...

  • 發佈於 2021-03-15 08:58
  • 閲讀 ( 47 )

最好的無需安裝的便攜應用程式

...個行動式應用程式扔到快閃記憶體驅動器上,然後從任何Windows計算機上執行你的應用程式。 ...

  • 發佈於 2021-03-18 12:35
  • 閲讀 ( 68 )

如何用一個外掛讓notepad++比較兩個檔案

...可以讓您看到兩個檔案之間的視覺差異。我們將向您展示如何使用這個外掛來比較Notepad++中的兩個檔案。 ...

  • 發佈於 2021-03-20 01:58
  • 閲讀 ( 114 )

雙啟動與虛擬機器:哪一個適合你?

...級Linux發行版,則不需要太多。如果你要在macOS中虛擬化windows10,那麼你需要一個更現代的裝備。 ...

  • 發佈於 2021-03-25 01:47
  • 閲讀 ( 49 )

如何在啟動時用systemd執行linux程式

...立整合服務的過程,甚至與雜誌進行對話。 本教程演示如何設定啟動系統時啟動的系統服務。要在登入時啟動圖形程式,請改用桌面的啟動管理器。 啟動時執行程式 有時,您在計算機上安裝的軟體會將自己連線到Linux啟動過...

  • 發佈於 2021-04-01 17:43
  • 閲讀 ( 46 )
oo4028148
oo4028148

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦