|Buffered I/O operations. |
The directory listing API makes it possible to list files on remote servers.
Some of possible use cases:
At first, a directory needs to be opened by calling avio_open_dir() supplied with a URL and, optionally, AVDictionary containing protocol-specific parameters. The function returns zero or positive integer and allocates AVIODirContext on success.
This code tries to open a sample directory using smb protocol without any additional parameters.
Each directory's entry (i.e. file, another directory, anything else within AVIODirEntryType) is represented by AVIODirEntry. Reading consecutive entries from an opened AVIODirContext is done by repeatedly calling avio_read_dir() on it. Each call returns zero or positive integer if successful. Reading can be stopped right after the NULL entry has been read – it means there are no entries left to be read. The following code reads all entries from a directory associated with ctx and prints their names to standard output.