This commit is contained in:
hong-revo 2018-05-17 07:15:15 +10:00
Родитель c93db9219c
Коммит ee90ee7b10
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -64,14 +64,16 @@ list_azure_files <- function(share, dir, all_info=TRUE)
{
lst <- do_container_op(share, dir, options=list(comp="list", restype="directory"))
name <- sapply(lst$Entries, function(ent) ent$Name[[1]])
name <- vapply(lst$Entries, function(ent) ent$Name[[1]], FUN.VALUE=character(1))
if(!all_info)
return(name)
size <- sapply(lst$Entries,
function(ent) if(is_empty(ent$Properties)) NA else ent$Properties$`Content-Length`[[1]])
type <- if(is_empty(name)) character(0) else names(name)
size <- vapply(lst$Entries,
function(ent) if(is_empty(ent$Properties)) NA_character_ else ent$Properties$`Content-Length`[[1]],
FUN.VALUE=character(1))
data.frame(name=name, type=names(lst$Entries), size=as.numeric(size), stringsAsFactors=FALSE)
data.frame(name=name, type=type, size=as.numeric(size), stringsAsFactors=FALSE)
}