hs.fs.volume
Interact with OS X filesystem volumes
This is distinct from hs.fs in that hs.fs deals with UNIX filesystem operations, while hs.fs.volume interacts with the higher level OS X concept of volumes
API Overview
- Constants - Useful values which cannot be changed
- Functions - API calls offered directly by the extension
- Constructors - API calls which return an object, typically one that offers API methods
- Methods - API calls which can only be made on an object returned by a constructor
API Documentation
Constants
didMount
| Signature | hs.fs.volume.didMount |
|---|---|
| Type | Constant |
| Description |
A volume was mounted |
| Source | extensions/fs/libfs_volume.m line 12 |
didRename
| Signature | hs.fs.volume.didRename |
|---|---|
| Type | Constant |
| Description |
A volume changed either its name or mountpoint (or more likely, both) |
| Source | extensions/fs/libfs_volume.m line 24 |
didUnmount
| Signature | hs.fs.volume.didUnmount |
|---|---|
| Type | Constant |
| Description |
A volume was unmounted |
| Source | extensions/fs/libfs_volume.m line 16 |
willUnmount
| Signature | hs.fs.volume.willUnmount |
|---|---|
| Type | Constant |
| Description |
A volume is about to be unmounted |
| Source | extensions/fs/libfs_volume.m line 20 |
Functions
allVolumes
| Signature | hs.fs.volume.allVolumes([showHidden]) -> table |
|---|---|
| Type | Function |
| Description |
Returns a table of information about disk volumes attached to the system |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/fs/fs.lua line 35 |
eject
| Signature | hs.fs.volume.eject(path) -> boolean,string |
|---|---|
| Type | Function |
| Description |
Unmounts and ejects a volume |
| Parameters |
|
| Returns |
|
| Source | extensions/fs/libfs_volume.m line 120 |
Constructors
new
| Signature | hs.fs.volume.new(fn) -> watcher |
|---|---|
| Type | Constructor |
| Description |
Creates a watcher object for volume events |
| Parameters |
|
| Returns |
|
| Source | extensions/fs/libfs_volume.m line 148 |
Methods
start
| Signature | hs.fs.volume:start() |
|---|---|
| Type | Method |
| Description |
Starts the volume watcher |
| Parameters |
|
| Returns |
|
| Source | extensions/fs/libfs_volume.m line 208 |
stop
| Signature | hs.fs.volume:stop() |
|---|---|
| Type | Method |
| Description |
Stops the volume watcher |
| Parameters |
|
| Returns |
|
| Source | extensions/fs/libfs_volume.m line 232 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.fs.volume.html