Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

condition to check if parameter is a folder does not work #21

Open
icirillo opened this issue Nov 8, 2019 · 0 comments
Open

condition to check if parameter is a folder does not work #21

icirillo opened this issue Nov 8, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@icirillo
Copy link

icirillo commented Nov 8, 2019

The condition (in Program.cs):
File.GetAttributes(TestRunnerResultsDirectory) == FileAttributes.Directory

Does not always work. I had two issues:

  1. the folder I was using had the flag "Archive" checked so
    File.GetAttributes(TestRunnerResultsDirectory)
    was returning:
    "Directory | Archive"

and the condition didn't work.
The condition should be improved with something like that:
https://stackoverflow.com/questions/13027700/comparing-2-fileattributes-must-always-return-true-in-c-sharp

  1. in another case (when using my laptop) not sure why but the line
    File.GetAttributes(TestRunnerResultsDirectory)
    was returning a numeric value: 1048624 (I think it's the hashcode)
@anshooarora anshooarora added the enhancement New feature or request label Dec 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants