[R-pkg-devel] shapefile .dbf recognised as executable
Many thanks for your guidance. Indeed there is a radical change: $ file OVforest.dbf OVforest.dbf: FoxBase+/dBase III DBF, 3 records * 22, update-date 95-7-26, at offset 97 1st record "beech beech leftnonbeech nonbeech rightnonbeechnonbeech" $ file OVforest2.dbf OVforest2.dbf: amd 29k coff prebar executable I don't recognize the file descriptors (amd, coff, prebar). I guess I need to call in help from the GIS people... Murray
From: Duncan Murdoch <murdoch.duncan at gmail.com>
Sent: 12 February 2022 11:44
To: Murray Efford; R-package-devel at r-project.org
Subject: Re: [R-pkg-devel] shapefile .dbf recognised as executable
Sent: 12 February 2022 11:44
To: Murray Efford; R-package-devel at r-project.org
Subject: Re: [R-pkg-devel] shapefile .dbf recognised as executable
On 11/02/2022 5:22 p.m., Murray Efford wrote:
> I have long distributed a small spatial ESRI shapefile as demonstration data in the extdata directory of 'secr'. It comprises the three files OVforest.shp, OVforest.dbf and OVforest.shx. I wanted to make minor changes (adding a coordinate reference system, dropping an attribute). I find that after merely reading (sf::st_read("OVforest.shp") and re-writing the same (sf::st_write("OVforest.shp")) the .dbf file is recognised by R CMD check as executable and raises a Warning (on GNU/Linux, but not in Windows).
>
> No doubt this can be blamed on specifics of the driver used by sf::st_write, but I have been unable to find any settings that might change the behaviour.
>
> I would like to know: Is this a false positive, and if not, How can I remove the executable component(s)? Can I apply the test used by R CMD check outside of R CMD check?
It's not easy to run just that test, but you can see it if you look here:
https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwch%2Fr-source%2Fblob%2F988077a792e628677bd5884b351fe08b2c17b8c8%2Fsrc%2Flibrary%2Ftools%2FR%2Fcheck.R%23L4866-L4941&data=04%7C01%7Cmurray.efford%40otago.ac.nz%7Ce242631c41c342f47d8908d9edb008b8%7C0225efc578fe4928b1579ef24809e9ba%7C0%7C0%7C637802163497599994%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Z77T09j1sONATxupZGSmkayrpjt3Ra1g%2FS6vxQq8CJs%3D&reserved=0
The basic idea is that it uses the "file" command. There are some known
false positives.
If you are on Linux, try running "file OVforest.dbf" and see what it says.
Duncan Murdoch