nealrichardson / httptest

A Test Environment for HTTP Requests in R
https://enpiar.com/r/httptest/
Other
79 stars 10 forks source link

Long filepaths (over 100 bytes) fail R CMD check #64

Open flodel opened 2 years ago

flodel commented 2 years ago

Hello, I am hoping that in a future release you can reduce the length of the filepaths/filenames that are generated for storing the response data. Currently, you are including the URL in the filepath, which is leading to very long filepaths. When a file path reaches 100 bytes, it causes warnings in the R CMD check of a package I am writing:

Tarballs are only required to store paths of up to 100 bytes and cannot store those of more than 256 bytes, with restrictions including to 100 bytes for the final component. See section 'Package structure' in the 'Writing R extensions' manual.

I guess you could shorten the filepaths by using hash signatures. Or you could create random short filenames but keep a mapping in a central file. Just throwing some ideas.

Thanks for the useful package.

maelle commented 2 years ago

@flodel you might find https://enpiar.com/r/httptest/index.html#how-do-i-fix-non-portable-file-paths useful

Now if you're using with_mock_dir(), see #71