Я пытаюсь проверить, существует ли файл на s3 через Rstudio на экземпляре Amazon EC2. exists()
функция Base R и file.exists()
функции возвращают FALSE
для каждого файла. Ниже приведен мой код, exists.type
существует в s3 и not_exists.type
не существует.
library("aws.s3")
Sys.setenv("AWS_ACCESS_KEY_ID" = "key1",
"AWS_SECRET_ACCESS_KEY" = "key2",
"AWS_DEFAULT_REGION" = "key3"
)
existing_file_path = "s3://bucket_name/folder_name/exists.type"
not_existing_file_path = "s3://bucket_name/folder_name/not_exists.type"
exists(existing_file_path) #returns FALSE
exists(not_existing_file_path) #returns FALSE
file.exists(existing_file_path) returns FALSE
file.exists(not_existing_file_path) returns FALSE
aws.s3::get_object(existing_file_path) #reads the entire file
aws.s3::get_object(not_existing_file_path) #gives error
Я пытался list.files
также, он возвращает character(0)
.