-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
Description
In R/geographies.R around lines 60-66, there is a hardcoded temporary directory name "XXXX" used for nested zip extraction:
tmp_dir <- file.path(geo_base_path,"XXXX")Issues
- Collision risk: If extraction is interrupted or fails, the "XXXX" directory may persist and cause issues on subsequent runs
- Non-descriptive name: Makes debugging harder
- Not using tempdir(): Standard R practice is to use
tempfile()ortempdir()for temporary directories
Suggested Fix
Replace with:
tmp_dir <- tempfile(pattern = "cancensus_geo_", tmpdir = geo_base_path)Or use withr::local_tempdir() for automatic cleanup.
Impact
Low - rare edge case, but could cause confusing errors if a user has an existing "XXXX" directory or if extraction fails mid-process.
Metadata
Metadata
Assignees
Labels
No labels