Skip to content

read_file on empty file throws error #356

Description

@torbjorn

I'd expect to get an empty string, but instead get:
Error: Cannot read file /tmp/RtmpFO5GFJ/file4dc73de7d6a2.txt

This could be what you designed it to do, but its arguably not what most users would expect from this function, and it should at least be documented (and tested for)

My testcase:

f <- tempfile( fileext=".txt" )
cat( "", file=f )
expect_true( file.exists(f) )
expect_that(
    read.file( f ),
    is_identical_to( "" )
)

Metadata

Metadata

Assignees

Labels

featurea feature request or enhancement

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions