-
Notifications
You must be signed in to change notification settings - Fork 1k
add fread file connection support #7422
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
Open
ben-schwen
wants to merge
33
commits into
master
Choose a base branch
from
fread_connections
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
00dc7bb
add fread connection support
ben-schwen 78bce0e
fix testnum
ben-schwen 0afd468
make linterse happy
ben-schwen fa79c8c
make linters even more happy
ben-schwen 9590e22
remove read bytes %d since this can overflow
ben-schwen 58b3386
add coverage
ben-schwen 995d2dc
be fully experimental API compliant
ben-schwen 3866b6d
more coverage
ben-schwen 8294c6f
update error message for nrow and mmap
ben-schwen 1b7cec7
add wording changes
ben-schwen 9b3c387
add connections guard
ben-schwen 3da8943
add strerrors
ben-schwen f6f9ed3
add errno lib
ben-schwen 5a98e62
add reopen_connection generic
ben-schwen d76c3a5
close con on exit
ben-schwen d520cd4
adjust doc
ben-schwen c3f7cf6
update conncection info
ben-schwen 4235a5c
reopen connection
ben-schwen e37b0ee
change modes
ben-schwen 2bcfc6c
update docs
ben-schwen 2e67cc2
add nocov
ben-schwen 4383ae2
use R_ExecWithCleanup to clean up on errors
ben-schwen 5e91780
add test for consuming before fread
ben-schwen 5182c0c
use factory pattern
ben-schwen 441c557
add aliases for S3 methods
ben-schwen 63fa168
Merge branch 'master' into fread_connections
ben-schwen a609fda
capture print in test
ben-schwen daabbb7
fix namespace
ben-schwen 1a98f38
rename to binary_reopener
ben-schwen 5eef830
More #ifdef wrapping for connections API
aitap 0c6eff5
R_FINITE will always be true for a size_t argument
aitap 236bc5c
Fail when nrow_limit exceeds SIZE_MAX
aitap 6f4d90f
Use translateChar() for native encoding string
aitap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| \name{binary_reopener} | ||
| \alias{binary_reopener} | ||
| \alias{binary_reopener.default} | ||
| \alias{binary_reopener.file} | ||
| \alias{binary_reopener.gzfile} | ||
| \alias{binary_reopener.bzfile} | ||
| \alias{binary_reopener.url} | ||
| \alias{binary_reopener.unz} | ||
| \alias{binary_reopener.pipe} | ||
| \title{ Create a function to open connections in binary mode } | ||
| \description{ | ||
| S3 generic that returns a function to open a connection in binary read mode. Used internally by \code{fread}. Exported so packages with custom connection classes can define methods. | ||
| } | ||
| \usage{ | ||
| binary_reopener(con, ...) | ||
| } | ||
| \arguments{ | ||
| \item{con}{ A connection object. } | ||
| \item{...}{ Additional arguments passed to the connection constructor. } | ||
| } | ||
| \details{ | ||
| Returns a function that accepts a description argument and opens a connection in binary read mode (\code{"rb"}). Methods are provided for \code{file}, \code{gzfile}, \code{bzfile}, \code{url}, \code{unz} and \code{pipe} connections. | ||
|
|
||
| To support custom connection types with \code{fread}, define a method for your connection class that returns an opener function. | ||
| } | ||
| \value{ | ||
| A function that accepts a description argument and returns a connection object opened in binary read mode. | ||
| } | ||
| \examples{ | ||
| \dontrun{ | ||
| # Define a method for a custom connection class | ||
| binary_reopener.my_con = function(con, ...) { | ||
| function(description) my_con(description, mode = "rb", ...) | ||
| } | ||
| } | ||
| } | ||
| \seealso{ | ||
| \code{\link{fread}} | ||
| } | ||
| \keyword{ data } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.