Closed christianrickert closed 2 years ago
Hi @christianrickert , thanks for the pull request, looks reasonable.
Merging #364 (c9992b5) into master (2ace59a) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #364 +/- ##
=======================================
Coverage 67.76% 67.76%
=======================================
Files 34 34
Lines 8931 8931
=======================================
Hits 6052 6052
Misses 2879 2879
Impacted Files | Coverage Δ | |
---|---|---|
R/WorkbookClass.R | 60.44% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3ceeb84...c9992b5. Read the comment docs.
The creation of
tmpDir
fails, when the Windows system variables TEMP/TMP are set to the root directory of an (external) drive:tempDir()
andfile.path(tempDir())
return the same temporary path, which leads to the described error:When
dir.create
tries to recursively create the directory structure, it fails because it cannot access the mounting point of the drive ("drive letter with separator") for writing - while any files and folders placed at the root directory level are fully accessible with the respective file system permissions granted:Interestingly, the recursive creation of the
tmpDir
works when thetmpdir
variable is set toT:
instead ofT:\
.There are two possible workarounds without altering the code:
tempfile
, andHowever, both options mask another problem with the current code:
In the
saveWorkBook
function ofWorkbookClass.R
, we are creating a single folder in the system's temp directory: There is no need to recursively create the directory structure for a single folder.The system's temp folder is automatically created by
tempfile(pattern = "file", tmpdir = tempdir())
, see documentation:The second change to the code is addressing an issue with
file.exists
(see: docs) and directories:A better function to check if a directory exists would be
dir.exists
(see?dir.exists
:Please consider these code changes for review.