bk99.de entertain the web since 1997

File access on Windows and Linux compared

Summary

Microsoft's WSL discussion explains why Windows and Linux file semantics produce different access checks, locks and performance profiles. The discussion comes from the public WSL issue tracker. DrvFS makes Windows drives available under WSL.

Ideas

  • Windows checks sharing modes as soon as a file is opened.
  • Unix often allows operations on deleted files that are still open.
  • WSL has to map Linux calls onto Windows file system behaviour.
  • Many small metadata accesses considerably amplify translation costs.

Insights

  • Compatibility requires faithful behaviour, not just functions with the same names.
  • File system semantics shape tools right up to build systems and package managers.
  • Performance drops often arise from many cheap individual operations across an abstraction boundary.

Facts

  • Linux and Windows treat open files differently.

Recommendations

  • Keep Linux working trees in the native WSL file system.
  • Explicitly test file locks and renames across platforms.

References

Read the original article

Search the Web Archive