get_file_by_name: Get file via name

Description Usage Arguments Examples

View source: R/files.R

Description

Allows you to pull the a list of file names that match the names that you provide to the file. Due to Google Drive's nature to allow multiple files with the same name to coexist in the same folder, you may be able to obtain a list of files even if you put matchType exact

Usage

1
2
get_file_by_name(file_name, match_type, id = "root", page_size = NULL,
  page_token = NULL, order_by = NULL, spaces = NULL, corpus = NULL)

Arguments

id

FolderID to search in. 'all' is also accepted which would mean to search the whole of user's drive

page_size

Optional. The maximum number of files to return per page. Acceptable values are 1 to 1000, inclusive. (Default: 100)

page_token

Optional. The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.

order_by

Optional. A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?order_by=folder,modifiedTime desc,name.

spaces

Optional. A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.

corpus

Optional. The source of files to list. Acceptable values are domain and user

filename

Name of the file in the Drive folder

matchType

Either exact or contains or not_equal

Examples

1
2
3
4
5
6
7
## Not run: 
library(googledrive)
authorize()
# Folder id is 0XXXXXXXX
get_file_by_name('some_file_name', 'exact', '0XXXXXXXX')

## End(Not run)

hairizuanbinnoorazman/googledrive documentation built on May 17, 2019, 2:25 p.m.