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

fread locks file if it encounters an error (Windows) #2044

HughParsonage opened this issue Feb 26, 2017 · 0 comments

fread locks file if it encounters an error (Windows) #2044

HughParsonage opened this issue Feb 26, 2017 · 0 comments


Copy link

@HughParsonage HughParsonage commented Feb 26, 2017

This seems to reopen a previously solved issue:

Given an improperly written csv (empty-field.csv):


When I run:


I get the error (as expected):

Error in fread("~/sandbox/empty-field.csv") :
Expecting 2 cols, but line 3 contains text after processing all cols. Try again with fill=TRUE. Another reason could be that fread's logic in distinguishing one or more fields having embedded sep=',' and/or (unescaped) '\n' characters within unbalanced unescaped quotes has failed. If quote='' doesn't help, please file an issue to figure out if the logic could be improved.

However, when I go to edit empty-field.csv (in Sublime Text 3), I get the error message

Unable to save empty-field.csv
Error: The requested operation cannot be performed on a file with a user-mapped section open.

Closing and reopening Sublime Text 3 does not solve the problem: R has to be closed. I encounter a similar error message with Notepad++, but I do not encounter any problems with Notepad.

I'm using the dev version: data.table 1.10.5 IN DEVELOPMENT built 2017-02-09 02:16:47 UTC; travis


R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.10.5

loaded via a namespace (and not attached):
[1] tools_3.3.2
@mattdowle mattdowle added this to the v1.10.6 milestone Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants