Skip to content

Instantly share code, notes, and snippets.

@adamhsparks
Last active May 10, 2024 11:04
Show Gist options
  • Save adamhsparks/18f7702906f33dd66788e0078979ff9a to your computer and use it in GitHub Desktop.
Save adamhsparks/18f7702906f33dd66788e0078979ff9a to your computer and use it in GitHub Desktop.
list ftp site files using {curl} (not {RCurl}) in R
ftp_base <- "ftp://"
list_files <- curl::new_handle()
curl::handle_setopt(list_files, ftp_use_epsv = TRUE, dirlistonly = TRUE)
con <- curl::curl(url = ftp_base, "r", handle = list_files)
files <- readLines(con)
close(con)
@oousmane
Copy link

Thank you for sharing this. This will help me a lot. Just wrapped your code into a tiny function !

@adamhsparks
Copy link
Author

Awesome! Glad it’s useful. That’s why I shared it so others could use it. Thanks for letting me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment