Disk

Data Structures | Typedefs | Enumerations | Functions | Variables
Disk
Eeze

Scan and query information about disks. More...

## Data Structures
struct | _Eeze_Event_Disk
struct | _Eeze_Event_Disk_Error

## Typedefs
typedef struct _Eeze_Event_Disk | Eeze_Event_Disk_Mount
typedef struct _Eeze_Event_Disk | Eeze_Event_Disk_Unmount
typedef struct _Eeze_Event_Disk | Eeze_Event_Disk_Eject
typedef struct _Eeze_Disk | Eeze_Disk
typedef struct _Eeze_Event_Disk_Error | Eeze_Event_Disk_Error

## Enumerations
enum | Eeze_Disk_Type { EEZE_DISK_TYPE_UNKNOWN = 0 , EEZE_DISK_TYPE_INTERNAL = (1 << 0) , EEZE_DISK_TYPE_CDROM = (1 << 1) , EEZE_DISK_TYPE_USB = (1 << 2) , EEZE_DISK_TYPE_FLASH = (1 << 3) }
enum | Eeze_Mount_Opts { EEZE_DISK_MOUNTOPT_LOOP = (1 << 1) , EEZE_DISK_MOUNTOPT_UTF8 = (1 << 2) , EEZE_DISK_MOUNTOPT_NOEXEC = (1 << 3) , EEZE_DISK_MOUNTOPT_NOSUID = (1 << 4) , EEZE_DISK_MOUNTOPT_REMOUNT = (1 << 5) , EEZE_DISK_MOUNTOPT_UID = (1 << 6) , EEZE_DISK_MOUNTOPT_NODEV = (1 << 7) }

## Functions
EAPI void | eeze_disk_function (void)
| Use this function to determine whether your eeze is disk-capable. More...
EAPI Eina_Bool | eeze_disk_can_mount (void)
| Return whether mount support is available in eeze. More...
EAPI Eina_Bool | eeze_disk_can_unmount (void)
| Return whether unmount support is available in eeze. More...
EAPI Eina_Bool | eeze_disk_can_eject (void)
| Return whether eject support is available in eeze. More...
EAPI Eeze_Disk * | eeze_disk_new (const char *path)
| Create a new disk object from a /sys/ path or /dev/ path. More...
EAPI Eeze_Disk * | eeze_disk_new_from_mount (const char *mount_point)
| Create a new disk object from a mount point. More...
EAPI void | eeze_disk_free (Eeze_Disk *disk)
| Frees a disk object. More...
EAPI void | eeze_disk_scan (Eeze_Disk *disk)
| Retrieve all disk information. More...
EAPI void | eeze_disk_data_set (Eeze_Disk *disk, void *data)
| Associate data with a disk. More...
EAPI void * | eeze_disk_data_get (Eeze_Disk *disk)
| Retrieve data previously associated with a disk. More...
EAPI const char * | eeze_disk_syspath_get (Eeze_Disk *disk)
| Return the /sys/ path of a disk. More...
EAPI const char * | eeze_disk_devpath_get (Eeze_Disk *disk)
| Return the /dev/ path of a disk. More...
EAPI const char * | eeze_disk_fstype_get (Eeze_Disk *disk)
| Return the filesystem of the disk (if known) More...
EAPI const char * | eeze_disk_vendor_get (Eeze_Disk *disk)
| Return the manufacturing vendor of the disk. More...
EAPI const char * | eeze_disk_model_get (Eeze_Disk *disk)
| Return the model of the disk. More...
EAPI const char * | eeze_disk_serial_get (Eeze_Disk *disk)
| Return the serial number of the disk. More...
EAPI const char * | eeze_disk_uuid_get (Eeze_Disk *disk)
| Return the UUID of the disk. More...
EAPI const char * | eeze_disk_label_get (Eeze_Disk *disk)
| Return the label of the disk. More...
EAPI Eeze_Disk_Type | eeze_disk_type_get (Eeze_Disk *disk)
| Return the Eeze_Disk_Type of the disk. More...
EAPI Eina_Bool | eeze_disk_removable_get (Eeze_Disk *disk)
| Return whether the disk is removable. More...
EAPI Eina_Bool | eeze_disk_mounted_get (Eeze_Disk *disk)
| Return the mount state of a disk. More...
EAPI const char * | eeze_disk_mount_wrapper_get (Eeze_Disk *disk)
| Get the previously set mount wrapper for a disk. More...
EAPI Eina_Bool | eeze_disk_mount_wrapper_set (Eeze_Disk *disk, const char *wrapper)
| Set a wrapper to run mount commands with. More...
EAPI Eina_Bool | eeze_disk_mount (Eeze_Disk *disk)
| Begin a mount operation on the disk. More...
EAPI Eina_Bool | eeze_disk_unmount (Eeze_Disk *disk)
| Begin an unmount operation on the disk. More...
EAPI Eina_Bool | eeze_disk_eject (Eeze_Disk *disk)
| Begin an eject operation on the disk. More...
EAPI void | eeze_disk_cancel (Eeze_Disk *disk)
| Cancel a pending operation on the disk. More...
EAPI const char * | eeze_disk_mount_point_get (Eeze_Disk *disk)
| Return the mount point of a disk. More...
EAPI Eina_Bool | eeze_disk_mount_point_set (Eeze_Disk *disk, const char *mount_point)
| Set the mount point of a disk. More...
EAPI Eina_Bool | eeze_disk_mountopts_set (Eeze_Disk *disk, unsigned long opts)
| Set the mount options using flags. More...
EAPI unsigned long | eeze_disk_mountopts_get (Eeze_Disk *disk)
| Get the flags of a disk's current mount options. More...
EAPI Eina_Bool | eeze_mount_tabs_watch (void)
| Begin watching mtab and fstab. More...
EAPI void | eeze_mount_tabs_unwatch (void)
| Stop watching /etc/fstab and /etc/mtab. More...
EAPI Eina_Bool | eeze_mount_mtab_scan (void)
| Scan /etc/mtab a single time. More...
EAPI Eina_Bool | eeze_mount_fstab_scan (void)
| Scan /etc/fstab a single time. More...
EAPI const char * | eeze_disk_udev_get_property (Eeze_Disk *disk, const char *property)
| Get the property value of a disk. More...
EAPI const char * | eeze_disk_udev_get_sysattr (Eeze_Disk *disk, const char *sysattr)
| Get the sysattr value of a disk. More...
EAPI const char * | eeze_disk_udev_get_parent (Eeze_Disk *disk)
| Find the root device of a disk. More...
EAPI Eina_Bool | eeze_disk_udev_walk_check_sysattr (Eeze_Disk *disk, const char *sysattr, const char *value)
| Walks up the device chain using the device from `disk`, checking each device for `sysattr` with (optional) `value`. More...
EAPI const char * | eeze_disk_udev_walk_get_sysattr (Eeze_Disk *disk, const char *sysattr)
| Walks up the device chain of `disk` checking each device for `sysattr` and returns the value if found. More...

## Variables
EAPI int | EEZE_EVENT_DISK_MOUNT
EAPI int | EEZE_EVENT_DISK_UNMOUNT
EAPI int | EEZE_EVENT_DISK_EJECT
EAPI int | EEZE_EVENT_DISK_ERROR

## Detailed Description

Scan and query information about disks.

Manipulate them with moun, unmount and eject.

## Typedef Documentation

## ◆ Eeze_Disk

Eeze_Disk

Since
  1.1

Handle for an Eeze Disk.

## ◆ Eeze_Event_Disk_Error

Eeze_Event_Disk_Error

Since
  1.1

Contains the human readable error message.

## Enumeration Type Documentation

## ◆ Eeze_Disk_Type

enum Eeze_Disk_Type

Since
  1.1

All disk types known to Eeze.

Enumerator
EEZE_DISK_TYPE_UNKNOWN | type could not be determined
EEZE_DISK_TYPE_INTERNAL | internal drive
EEZE_DISK_TYPE_CDROM | cdrom drive
EEZE_DISK_TYPE_USB | usb drive
EEZE_DISK_TYPE_FLASH | flash disk

## ◆ Eeze_Mount_Opts

enum Eeze_Mount_Opts

Since
  1.1

All mount options known to Eeze.

Enumerator
EEZE_DISK_MOUNTOPT_UID | use current user's uid
EEZE_DISK_MOUNTOPT_NODEV | Since 1.7

## Function Documentation

## ◆ eeze_disk_function()

EAPI void eeze_disk_function | ( | void |  | ) |

Use this function to determine whether your eeze is disk-capable.

Since applications will die if they run/compile against a function that doesn't exist, if your application successfully runs/compiles with this function then you have eeze_disk.

Since
  1.1

## ◆ eeze_disk_can_mount()

EAPI Eina_Bool eeze_disk_can_mount | ( | void |  | ) |

Return whether mount support is available in eeze.

Use this function to determine whether your Eeze library was compiled with a mount binary available.

Since
  1.1

References EINA_FALSE.

## ◆ eeze_disk_can_unmount()

EAPI Eina_Bool eeze_disk_can_unmount | ( | void |  | ) |

Return whether unmount support is available in eeze.

Use this function to determine whether your Eeze library was compiled with an unmount binary available.

Since
  1.1

References EINA_FALSE.

## ◆ eeze_disk_can_eject()

EAPI Eina_Bool eeze_disk_can_eject | ( | void |  | ) |

Return whether eject support is available in eeze.

Use this function to determine whether your Eeze library was compiled with an eject binary available.

Since
  1.1

References EINA_FALSE.

## ◆ eeze_disk_new()

EAPI Eeze_Disk* eeze_disk_new | ( | const char * | path | ) |

Create a new disk object from a /sys/ path or /dev/ path.

Parameters

  path | The /sys/ or /dev path of the disk; CANNOT be `NULL`.

Returns
  The new disk object

This function creates a new Eeze_Disk from `path`. Note that this function does the minimal amount of work in order to save memory, and udev info about the disk is not retrieved in this call.

Since
  1.1

References eeze_udev_devpath_get_syspath(), EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), eina_stringshare_del(), and EINA_TRUE.

## ◆ eeze_disk_new_from_mount()

EAPI Eeze_Disk* eeze_disk_new_from_mount | ( | const char * | mount_point | ) |

Create a new disk object from a mount point.

Parameters

  mount_point | The mount point of the disk; CANNOT be `NULL`

Returns
  The new disk object

This function creates a new Eeze_Disk from `mount_point`. Note that this function does the minimal amount of work in order to save memory, and udev info about the disk is not retrieved in this call. If the disk is not currently mounted, it must have an entry in /etc/fstab.

Since
  1.1

References eeze_udev_devpath_get_syspath(), EINA_FALSE, eina_list_append(), EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_add(), eina_stringshare_del(), and EINA_TRUE.

## ◆ eeze_disk_free()

EAPI void eeze_disk_free | ( | Eeze_Disk * | disk | ) |

Frees a disk object.

Parameters

  disk | The disk object to free

This call frees an Eeze_Disk. Once freed, the disk can no longer be used.

Since
  1.1

References ecore_exe_kill(), eina_list_remove(), EINA_SAFETY_ON_NULL_RETURN, and eina_strbuf_free().

## ◆ eeze_disk_scan()

EAPI void eeze_disk_scan | ( | Eeze_Disk * | disk | ) |

Retrieve all disk information.

Parameters

  disk | Use this function to retrieve all of a disk's information at once, then use a "get" function to retrieve the value. Data retrieved in this call is cached, meaning that subsequent calls will return immediately without performing any work.

Since
  1.1

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN, eina_stringshare_del(), and EINA_TRUE.

## ◆ eeze_disk_data_set()

EAPI void eeze_disk_data_set | ( | Eeze_Disk * | disk,
|  | void * | data
| ) |  |

Associate data with a disk.

Parameters

  disk | The disk
  data | The data

Data can be associated with `disk` with this function.

See also
  eeze_disk_data_get

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN.

## ◆ eeze_disk_data_get()

EAPI void* eeze_disk_data_get | ( | Eeze_Disk * | disk | ) |

Retrieve data previously associated with a disk.

Parameters

  disk | The disk

Returns
  The data

Data that has been previously associated with `disk` is returned with this function.

See also
  eeze_disk_data_set

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_syspath_get()

EAPI const char* eeze_disk_syspath_get | ( | Eeze_Disk * | disk | ) |

Return the /sys/ path of a disk.

Parameters

  disk | The disk

Returns
  The /sys/ path

This retrieves the /sys/ path that udev associates with `disk`.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_devpath_get()

EAPI const char* eeze_disk_devpath_get | ( | Eeze_Disk * | disk | ) |

Return the /dev/ path of a disk.

Parameters

  disk | The disk

Returns
  The /dev/ path

This retrieves the /dev/ path that udev has created a device node at for `disk`.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by eeze_disk_eject(), eeze_disk_mount(), eeze_disk_mount_point_get(), and eeze_disk_unmount().

## ◆ eeze_disk_fstype_get()

EAPI const char* eeze_disk_fstype_get | ( | Eeze_Disk * | disk | ) |

Return the filesystem of the disk (if known)

Parameters

  disk | The disk

Returns
  The filesystem type

This retrieves the filesystem that the disk is using, or `NULL` if unknown.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_vendor_get()

EAPI const char* eeze_disk_vendor_get | ( | Eeze_Disk * | disk | ) |

Return the manufacturing vendor of the disk.

Parameters

  disk | The disk

Returns
  The vendor

This retrieves the vendor which manufactured the disk, or `NULL` if unknown.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_model_get()

EAPI const char* eeze_disk_model_get | ( | Eeze_Disk * | disk | ) |

Return the model of the disk.

Parameters

  disk | The disk

Returns
  The model

This retrieves the model of the disk, or `NULL` if unknown.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_serial_get()

EAPI const char* eeze_disk_serial_get | ( | Eeze_Disk * | disk | ) |

Return the serial number of the disk.

Parameters

  disk | The disk

Returns
  The serial number

This retrieves the serial number the disk, or `NULL` if unknown.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_uuid_get()

EAPI const char* eeze_disk_uuid_get | ( | Eeze_Disk * | disk | ) |

Return the UUID of the disk.

Parameters

  disk | The disk

Returns
  The UUID

This retrieves the UUID of the disk, or `NULL` if unknown. A UUID is a 36 character (hopefully) unique identifier which can be used to store persistent information about a disk.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by eeze_disk_mount(), and eeze_disk_mount_point_get().

## ◆ eeze_disk_label_get()

EAPI const char* eeze_disk_label_get | ( | Eeze_Disk * | disk | ) |

Return the label of the disk.

Parameters

  disk | The disk

Returns
  The label

This retrieves the label (name) of the disk, or `NULL` if unknown.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by eeze_disk_mount_point_get().

## ◆ eeze_disk_type_get()

EAPI Eeze_Disk_Type eeze_disk_type_get | ( | Eeze_Disk * | disk | ) |

Return the Eeze_Disk_Type of the disk.

Parameters

  disk | The disk

Returns
  The type

This retrieves the Eeze_Disk_Type of the disk. This call is useful for determining the bus that the disk is connected through.

Since
  1.1

References EEZE_DISK_TYPE_UNKNOWN, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_removable_get()

EAPI Eina_Bool eeze_disk_removable_get | ( | Eeze_Disk * | disk | ) |

Return whether the disk is removable.

Parameters

  disk | The disk

Returns
  `EINA_TRUE` if removable, `EINA_FALSE` otherwise.

Since
  1.1

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_stringshare_del().

## ◆ eeze_disk_mounted_get()

EAPI Eina_Bool eeze_disk_mounted_get | ( | Eeze_Disk * | disk | ) |

Return the mount state of a disk.

Parameters

  disk | The disk

Returns
  The mount state

This returns the mounted state of the disk. `EINA_TRUE` if mounted, `EINA_FALSE` otherwise.

Since
  1.1

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_mount_wrapper_get()

EAPI const char* eeze_disk_mount_wrapper_get | ( | Eeze_Disk * | disk | ) |

Get the previously set mount wrapper for a disk.

Parameters

  disk | The disk

Returns
  The wrapper, or `NULL` on failure.

This returns the wrapper previously set with eeze_disk_mount_wrapper_set

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_disk_mount_wrapper_set()

EAPI Eina_Bool eeze_disk_mount_wrapper_set | ( | Eeze_Disk * | disk,
|  | const char * | wrapper
| ) |  |

Set a wrapper to run mount commands with.

Parameters

  disk | The disk to wrap mount commands for
  wrapper | The wrapper executable

Returns
  `EINA_TRUE` on success, `EINA_FALSE` otherwise.

Use this function to set up a wrapper for running mount/umount commands. The wrapper must NOT use any of the standard mount/umount error code return values, and it must return 0 on success. Note that this function will call stat() on `wrapper` if not `NULL` to test for existence.

Since
  1.1

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, eina_stringshare_del(), eina_stringshare_replace(), and EINA_TRUE.

## ◆ eeze_disk_mount()

EAPI Eina_Bool eeze_disk_mount | ( | Eeze_Disk * | disk | ) |

Begin a mount operation on the disk.

Parameters

  disk | The disk

Returns
  `EINA_TRUE` if the operation was started, `EINA_FALSE` otherwise.

This call is used to begin a mount operation on `disk`. The operation will run asynchronously in a pipe, emitting an EEZE_EVENT_DISK_MOUNT event with the disk object as its event on completion. If any errors are encountered, they will automatically logged to the eeze_disk domain and an EEZE_EVENT_DISK_ERROR event will be generated with an Eeze_Event_Disk_Error struct as its event.

NOTE: The return value of this function does not in any way reflect the mount state of a disk.

Since
  1.1

References eeze_disk_devpath_get(), eeze_disk_mount_point_set(), eeze_disk_uuid_get(), EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_strbuf_append_printf(), eina_strbuf_new(), eina_strbuf_string_free(), and eina_stringshare_del().

## ◆ eeze_disk_unmount()

EAPI Eina_Bool eeze_disk_unmount | ( | Eeze_Disk * | disk | ) |

Begin an unmount operation on the disk.

Parameters

  disk | The disk

Returns
  `EINA_TRUE` if the operation was started, `EINA_FALSE` otherwise.

This call is used to begin an unmount operation on `disk`. The operation will run asynchronously in a pipe, emitting an EEZE_EVENT_DISK_UNMOUNT event with the disk object as its event on completion. If any errors are encountered, they will automatically logged to the eeze_disk domain and an EEZE_EVENT_DISK_ERROR event will be generated with an Eeze_Event_Disk_Error struct as its event.

NOTE: The return value of this function does not in any way reflect the mount state of a disk.

Since
  1.1

References ecore_exe_run(), eeze_disk_devpath_get(), EINA_FALSE, eina_list_append(), EINA_SAFETY_ON_NULL_RETURN_VAL, eina_strbuf_append_printf(), eina_strbuf_new(), eina_strbuf_string_free(), eina_strbuf_string_get(), EINA_TRUE, and INF.

Referenced by eeze_disk_eject().

## ◆ eeze_disk_eject()

EAPI Eina_Bool eeze_disk_eject | ( | Eeze_Disk * | disk | ) |

Begin an eject operation on the disk.

Parameters

  disk | The disk

Returns
  `EINA_TRUE` if the operation was started, `EINA_FALSE` otherwise.

This call is used to begin an eject operation on `disk`. The operation will run asynchronously in a pipe, emitting an EEZE_EVENT_DISK_EJECT event with the disk object as its event on completion. If any errors are encountered, they will automatically logged to the eeze_disk domain and an EEZE_EVENT_DISK_ERROR event will be generated with an Eeze_Event_Disk_Error struct as its event.

NOTE: The return value of this function does not in any way reflect the mount state of a disk.

Since
  1.1

References ecore_exe_run(), eeze_disk_devpath_get(), eeze_disk_unmount(), EINA_FALSE, eina_list_append(), EINA_SAFETY_ON_NULL_RETURN_VAL, eina_strbuf_append_printf(), eina_strbuf_new(), eina_strbuf_string_get(), EINA_TRUE, and INF.

## ◆ eeze_disk_cancel()

EAPI void eeze_disk_cancel | ( | Eeze_Disk * | disk | ) |

Cancel a pending operation on the disk.

Parameters

  disk | The disk

This function cancels the current pending operation on `disk` which was previously started with eeze_disk_mount or eeze_disk_unmount.

Since
  1.1

References ecore_exe_kill(), and EINA_SAFETY_ON_NULL_RETURN.

## ◆ eeze_disk_mount_point_get()

EAPI const char* eeze_disk_mount_point_get | ( | Eeze_Disk * | disk | ) |

Return the mount point of a disk.

Parameters

  disk | The disk

Returns
  The mount point

This function returns the mount point associated with `disk`. Note that to determine whether the disk is actually mounted, eeze_disk_mounted_get should be used.

Since
  1.1

References eeze_disk_devpath_get(), eeze_disk_label_get(), eeze_disk_uuid_get(), EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_stringshare_add().

## ◆ eeze_disk_mount_point_set()

EAPI Eina_Bool eeze_disk_mount_point_set | ( | Eeze_Disk * | disk,
|  | const char * | mount_point
| ) |  |

Set the mount point of a disk.

Parameters

  disk | The disk
  mount_point | The mount point

Returns
  `EINA_TRUE` on success, `EINA_FALSE` otherwise.

This function sets the mount point associated with `disk`. Note that to determine whether the disk is actually mounted, eeze_disk_mounted_get should be used. Also note that this function cannot be used while the disk is mounted to avoid losing the current mount point.

Since
  1.1

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_replace(), and EINA_TRUE.

Referenced by eeze_disk_mount().

## ◆ eeze_disk_mountopts_set()

EAPI Eina_Bool eeze_disk_mountopts_set | ( | Eeze_Disk * | disk,
|  | unsigned long | opts
| ) |  |

Set the mount options using flags.

Parameters

  disk | The disk
  opts | An ORed set of Eeze_Mount_Opts

Returns
  `EINA_TRUE` on success, `EINA_FALSE` otherwise.

This function replaces the current mount opts of a disk with the ones in `opts`.

Since
  1.1

References EEZE_DISK_MOUNTOPT_UID, EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.

## ◆ eeze_disk_mountopts_get()

EAPI unsigned long eeze_disk_mountopts_get | ( | Eeze_Disk * | disk | ) |

Get the flags of a disk's current mount options.

Parameters

  disk | The disk

Returns
  An ORed set of Eeze_Mount_Opts, 0 on failure

This function returns the current mount opts of a disk.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ eeze_mount_tabs_watch()

EAPI Eina_Bool eeze_mount_tabs_watch | ( | void |  | ) |

Begin watching mtab and fstab.

Returns
  `EINA_TRUE` if watching was started, `EINA_FALSE` otherwise.

This function creates inotify watches on /etc/mtab and /etc/fstab and watches them for changes. This function should be used when expecting a lot of disk mounting/unmounting while you need disk data since it will automatically update certain necessary data instead of waiting.

See also
  eeze_mount_mtab_scan, eeze_mount_fstab_scan

Since
  1.1

References ECORE_FD_ERROR, ecore_file_monitor_add(), ecore_main_fd_handler_file_add(), EINA_FALSE, EINA_SAFETY_ON_NULL_GOTO, EINA_TRUE, ERR, and fcntl().

## ◆ eeze_mount_tabs_unwatch()

EAPI void eeze_mount_tabs_unwatch | ( | void |  | ) |

Stop watching /etc/fstab and /etc/mtab.

This function stops watching fstab and mtab. Data obtained previously will be saved.

Since
  1.1

References ecore_file_monitor_del(), ecore_main_fd_handler_del(), and EINA_FALSE.

## ◆ eeze_mount_mtab_scan()

EAPI Eina_Bool eeze_mount_mtab_scan | ( | void |  | ) |

Scan /etc/mtab a single time.

Returns
  `EINA_TRUE` if mtab could be scanned, `EINA_FALSE` otherwise.

This function is used to perform a single scan on /etc/mtab. It is used to gather information about mounted filesystems which can then be used with your Eeze_Disk objects where appropriate. These files will automatically be scanned any time a mount point or mount state is requested unless eeze_mount_tabs_watch has been called previously, in which case data is stored for use. If this function is called after eeze_mount_tabs_watch, `EINA_TRUE` will be returned.

See also
  eeze_mount_tabs_watch, eeze_mount_fstab_scan

Since
  1.1

References EINA_FALSE, and EINA_TRUE.

## ◆ eeze_mount_fstab_scan()

EAPI Eina_Bool eeze_mount_fstab_scan | ( | void |  | ) |

Scan /etc/fstab a single time.

Returns
  `EINA_TRUE` if mtab could be scanned, `EINA_FALSE` otherwise.

This function is used to perform a single scan on /etc/fstab. It is used to gather information about mounted filesystems which can then be used with your Eeze_Disk objects where appropriate. These files will automatically be scanned any time a mount point or mount state is requested unless eeze_mount_tabs_watch has been called previously, in which case data is stored for use. If this function is called after eeze_mount_tabs_watch, `EINA_TRUE` will be returned.

See also
  eeze_mount_tabs_watch, eeze_mount_mtab_scan

Since
  1.1

References EINA_FALSE, and EINA_TRUE.

## ◆ eeze_disk_udev_get_property()

EAPI const char* eeze_disk_udev_get_property | ( | Eeze_Disk * | disk,
|  | const char * | property
| ) |  |

Get the property value of a disk.

Parameters

  disk | The disk
  property | The property to get; full list of these is a FIXME

Returns
  A stringshared char* with the property or `NULL` on failure.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, and eina_stringshare_add().

## ◆ eeze_disk_udev_get_sysattr()

EAPI const char* eeze_disk_udev_get_sysattr | ( | Eeze_Disk * | disk,
|  | const char * | sysattr
| ) |  |

Get the sysattr value of a disk.

Parameters

  disk | The disk
  sysattr | The sysattr to get; full list of these is a FIXME

Returns
  A stringshared char* with the sysattr or `NULL` on failure.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, and eina_stringshare_add().

## ◆ eeze_disk_udev_get_parent()

EAPI const char* eeze_disk_udev_get_parent | ( | Eeze_Disk * | disk | ) |

Find the root device of a disk.

Parameters

  disk | The disk

Returns
  The syspath of the parent device

Return a stringshared syspath (/sys/$syspath) for the parent device.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL, and eina_stringshare_add().

## ◆ eeze_disk_udev_walk_check_sysattr()

EAPI Eina_Bool eeze_disk_udev_walk_check_sysattr | ( | Eeze_Disk * | disk,
|  | const char * | sysattr,
|  | const char * | value
| ) |  |

Walks up the device chain using the device from `disk`, checking each device for `sysattr` with (optional) `value`.

Parameters

  disk | The disk to walk
  sysattr | The attribute to find
  value | OPTIONAL: The value that `sysattr` should have, or `NULL`.

Returns
  If the sysattr (with value) is found, returns `EINA_TRUE`, `EINA_FALSE` otherwise.

Since
  1.1

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, and EINA_TRUE.

## ◆ eeze_disk_udev_walk_get_sysattr()

EAPI const char* eeze_disk_udev_walk_get_sysattr | ( | Eeze_Disk * | disk,
|  | const char * | sysattr
| ) |  |

Walks up the device chain of `disk` checking each device for `sysattr` and returns the value if found.

Parameters

  disk | The disk
  sysattr | The attribute to find

Returns
  The stringshared value of `sysattr` if found, or `NULL`.

Since
  1.1

References EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, and eina_stringshare_add().