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

path_ext wrong when two dots present #382

Closed
tentacles-from-outer-space opened this issue May 14, 2022 · 2 comments · Fixed by #452
Closed

path_ext wrong when two dots present #382

tentacles-from-outer-space opened this issue May 14, 2022 · 2 comments · Fixed by #452
Labels
bug an unexpected problem or unintended behavior

Comments

@tentacles-from-outer-space

Two dots before file extension break path_ext:

path_ext("file..ext")
# [1] ""
@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label May 14, 2022
@dicorynia
Copy link

Also when more than 2 dots...

library(fs)
test <- c("abc.xyz", "abc..xyz", "abc...xyz")
path_ext(test)
#> [1] "xyz" ""    ""

Created on 2023-01-31 with reprex v2.0.2

Session info
sessionInfo()
#> R version 4.2.2 Patched (2022-11-10 r83330)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Linux Mint 21.1
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
#> 
#> locale:
#>  [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
#>  [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
#>  [7] LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] fs_1.6.0
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.31   withr_2.5.0     lifecycle_1.0.3 reprex_2.0.2   
#>  [5] evaluate_0.20   rlang_1.0.6     cli_3.6.0       rstudioapi_0.14
#>  [9] rmarkdown_2.20  tools_4.2.2     glue_1.6.2      xfun_0.36      
#> [13] yaml_2.3.7      fastmap_1.1.0   compiler_4.2.2  htmltools_0.5.4
#> [17] knitr_1.42

@giocomai
Copy link

Encountered this in the wild with filenames in the format - "Surname + initial", e.g. for John Smith,

Smith, J..csv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants