File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11package mountinfo
22
3+ import "io"
4+
35// GetMounts retrieves a list of mounts for the current running process,
46// with an optional filter applied (use nil for no filter).
57func GetMounts (f FilterFunc ) ([]* Info , error ) {
68 return parseMountTable (f )
79}
810
11+ // GetMountsFromReader retrieves a list of mounts from the
12+ // reader provided, with an optional filter applied (use nil
13+ // for no filter). This can be useful in tests or benchmarks
14+ // that provide a fake mountinfo data.
15+ func GetMountsFromReader (reader io.Reader , f FilterFunc ) ([]* Info , error ) {
16+ return parseInfoFile (reader , f )
17+ }
18+
919// Mounted determines if a specified mountpoint has been mounted.
1020// On Linux it looks at /proc/self/mountinfo.
1121func Mounted (mountpoint string ) (bool , error ) {
You can’t perform that action at this time.
0 commit comments