Consider reworking arguments to file()
See original GitHub issueI’m always having trouble remembering what checks exactly are performed for the different parameters to file()
. For example, does exists = false
check whether the file does not exist and fail otherwise? (No, it does not.) While that’s part of the documentation, I believe this could be made more clear by renaming parameters. How about:
exists
->verifyExists
fileOkay
->canBeFile
folderOkay
->canBeDir
writable
->mustBeWritable
readable
->mustBeReadable
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
c# - A class to load in command line arguments
In this case it is used to load the systems root path. The CommandLineArgs class is the class for the XML file is...
Read more >Options Summary (GNU make) - GNU.org
Possible arguments are below; only the first character is considered, and values must be comma- ... Ignore all errors in recipes executed to...
Read more >How to read from file in command-line arguments otherwise ...
This iterates over the lines of all files listed in sys.argv[1:], defaulting to sys.stdin if the list is empty. If a filename is...
Read more >CommandLine 2.0 Library Manual - Documentation - LLVM
Positional Arguments. Specifying positional options with hyphens; Determining absolute position with getPosition(); The cl::ConsumeAfter modifier.
Read more >Linux make command information and examples
The debugging information says which files are being considered for remaking, which file-times are being compared and with what results, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I decided on a solution that isn’t perfect, but that I’m okay with:
I added the
canBeSymlink
parameter to a new overload and deprecated the existing version as discussed. In addition, I added another overload with no parameters that isn’t deprecated. This way calls with no arguments (e.g.file()
) aren’t marked as deprecated.Calls with unnamed arguments (e.g.
file(true, false)
) will still always be marked as deprecated, but I doubt that pattern is common. People can always remove the deprecation by adding names to the arguments.There are actually two kinds of native “symlinks” on Windows: Junctions (for directories only; since Windows 2000) and “real” symbolic links (since Windows Vista). Both of these should be detected by my code snippet. The best tool I know to create / handle these on Windows is the Link Shell Extension.