Skip to content

Conversation

@iSazonov
Copy link
Collaborator

PR Summary

Related #6874. The PR is coming from a code review to cleanup psl. Here we clean up the side branch of the code that will allow later to clean up a branch which uses psl.

  • IO.FileInfo does not make system calls in constructor. So we can create the object and then use the required attributes without direct call IO.FileInfo.GetAttributes() ( SafeGetFileAttributes() ). This allow us to exclude some p/invoke calls in our code in later cleanups. Also we get unified code for both Windows and Unix.
  • Remove SafeGetFileAttributes() and WinSafeGetFileAttributes(). Currently .Net Core support file attributes on all platforms in fastest way and we can remove our workaround. We get a regression in rare case (for files like pagefile.sys). Fix is ready in CoreFX, we get it in 2.1.1. I suggest ignore the regression because this is a very-very rare situation (Get-ChildItem c:\pagefile.sys -Hidden). The .Net Core team was not even able to create an artificial test for such files and uses a real pagefile.sys file for the test. Also the enumeration is still working (dir c:\ -hidden).
  • Re-add test which we lost in Make CodeCoverage tests work with CodeCov.io and related fixes #4050. The test is pending because of the regression.

PR Checklist

iSazonov added 2 commits May 21, 2018 19:16
IO.FileInfo does not make system calls in constructor.  So we can create the object and then use the required attributes.
@iSazonov iSazonov force-pushed the psl-clean-winsafegetfileattributes branch from d850ef5 to ebe19a5 Compare May 21, 2018 14:17
@iSazonov iSazonov force-pushed the psl-clean-winsafegetfileattributes branch from 4b1fe47 to ef7430c Compare May 22, 2018 08:42
@iSazonov
Copy link
Collaborator Author

@SteveL-MSFT @daxian-dbw Could you please look the PR?

@iSazonov iSazonov mentioned this pull request May 24, 2018
11 tasks
@iSazonov
Copy link
Collaborator Author

iSazonov commented Jun 1, 2018

@daxian-dbw Seems the PR is ready to merge - could you please look?

@iSazonov iSazonov assigned iSazonov and unassigned daxian-dbw Jun 4, 2018
@iSazonov iSazonov merged commit 57b3d33 into PowerShell:master Jun 4, 2018
@iSazonov iSazonov deleted the psl-clean-winsafegetfileattributes branch June 4, 2018 05:01
@daxian-dbw daxian-dbw mentioned this pull request Jun 4, 2018
11 tasks
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.

4 participants