Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upIdea for a text/binary sniffing function. Want it? #236
Comments
This comment has been minimized.
This comment has been minimized.
Is this OS specific? |
This comment has been minimized.
This comment has been minimized.
I don't think so but I'll write some tests and see what the CI servers say. |
This comment has been minimized.
This comment has been minimized.
Pushed my feature branch, with tests. If Travis and Appveyor run successfully, I will make a one-commit version of that branch and submit a PR. |
…orm matter, completing ticket leeper#236. This can be useful when a file extension is missing or ambiguous
This comment has been minimized.
This comment has been minimized.
This function is not OS specific. It works identically on Windows: as well as Linux and MacOS: I have not been able to formally demonstrate this until now because CI scripts were broken by the R version update. Now that problem seems to have been fixed upstream. The test failures in #239 are out of date and will clear if https://travis-ci.org/leeper/rio/builds/608907693 and https://ci.appveyor.com/project/leeper/rio/builds/28698005 are resubmitted to their respective CI services (in the case of former, after switching to the default xcode in |
This comment has been minimized.
This comment has been minimized.
* isfiletext() checks whether a file is text or binary in a cross platform matter, completing ticket #236. This can be useful when a file extension is missing or ambiguous * Minor tweak-- removed redundant 'fwf' entry from 'txtformats' in the test for isfiletext() * Incorporating feedback from #239#pullrequestreview-335144814 and merging in changes to master * Incorporating review feedback
bokov commentedOct 4, 2019
Please specify whether your issue is about:
I got fed up the fact that my OS seems to always know which files are plain-text and yet my own code never does, so I did some googling and found this: https://stackoverflow.com/questions/32184809/python-file1-why-are-the-numbers-7-8-9-10-12-13-27-and-range0x20-0x100
That led to the function below. I'd rather contribute it to an existing package than try to tackle CRAN maintenance on my own, so if the below seems useful to include among rio's utilities I'll submit it as a PR.
Put your code here: