ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Drive functions
  • parameter
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Lists the files in a cloud-based drive directory.
Note: Google Drive-specific files (Sheets, Docs, etc.) are not listed.
Example
oOAuth2Param is OAuth2Parameters
oOAuth2Param.ClientID = "client_id"
oOAuth2Param.ClientSecret = "client_secret"
oOAuth2Param.RedirectionURL = "http://localhost:9000/"

oDrive is Drive
oDrive = oDriveConnect(oOAuth2Param)

AFile, ResListFile are strings
// Lists all the files in my drive from the "MyPhotos" directory
// Only the current directory is examined 
ResListFile = DriveListFile(oDrive, "/MyPhotos/", frNotRecursive)

// For each file found
FOR EACH STRING AFile OF ResListFile SEPARATED BY CR
	// Add the file into TABLE_FileTable
	TableAdd(TABLE_FileTable, AFile)
END
Syntax
<Result> = DriveListFile(<Drive> , <Start path> [, <Options>])
<Result>: Character string
List of files on the specified drive, at the specified location.
  • If the fdFullInformation is not specified, this list is of the form:
    <Name of file 1> + CR  + ... + <Name of file N>
  • New in version 2025
    If the fdFullInformation constant is specified, this list is of the form:
    <Name of file 1> + TAB + <Path of file 1> + TAB + <Size (bytes) of file 1> + TAB +
    <Date modified 1> + CR + ... + <Name of file N> + TAB + <Path of file N> + TAB +
    <Size (bytes) of file N> + TAB + <Date modified N>
<Drive>: Drive variable
Name of the Drive or gglDrive variable that corresponds to the drive to be used. The connection to the drive must have been previously established. Otherwise, files will not be listed.
<Start path>: Character string
Drive path from which files are to be listed. This must be an absolute path:
  • Directory names must be separated by '/' or '\'.
  • Directory names must start with '/' or '\'.
If the path is invalid, an error will be generated.
<Options>: Optional Integer constant (or combination of constants)
Type of iteration:
New in version 2025
fdFullInformation
Provides detailed information on the files hosted on the drive.
This constant must be used with the frNotRecursive or frRecursiveconstants.
frNotRecursiveThe iteration is non-recursive. Subdirectories are ignored.
frRecursive
(Default value)
The iteration is recursive. Subdirectories are automatically taken into account.
Remarks

<Start path> parameter

Examples of valid paths:
"/holidays directory/2021/"
"\photos"
Examples of invalid paths:
"directoryA/DirectoryB"
"This/Path/Is/invalid"
"c:\Users\"
Related Examples:
Drive functions Unit examples (WINDEV): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
Drive functions Unit examples (WINDEV Mobile): Drive functions
[ + ] This example illustrates the use of Drive functions (Google Drive, Dropbox, OneDrive).
Business / UI classification: Business Logic
Component: wd300ggl.dll
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/09/2024

Send a report | Local help