readdir


Description:

[ CCode ( array_length = false , array_null_terminated = true ) ]
[ Version ( since = "1.0.55" ) ]
public Dirent[] readdir (string dir) throws Error

read directories entries

This returns the list of directory entries in directory dir.

All entries in the directory are returned, including "." and "..". The entries are *not* sorted, but returned in the same order as the underlying filesystem.

Also this call returns basic file type information about each file. The ftyp field will contain one of the following characters:

'b' Block special

'c' Char special

'd' Directory

'f' FIFO (named pipe)

'l' Symbolic link

'r' Regular file

's' Socket

'u' Unknown file type

'?' The readdir(3) call returned a d_type field with an unexpected value

This function is primarily intended for use by programs. To get a simple list of names, use ls. To get a printable directory for human consumption, use ll.

Parameters:

this

A GuestfsSession object

Returns:

an array of Dirent objects, or NULL on error