{"id":17919838,"url":"https://github.com/dwisiswant0/unmountpoint","last_synced_at":"2025-08-15T14:31:51.792Z","repository":{"id":57644963,"uuid":"440547459","full_name":"dwisiswant0/unmountpoint","owner":"dwisiswant0","description":"Go library to wait for the detached/unmounted state of a path.","archived":false,"fork":false,"pushed_at":"2021-12-21T15:29:17.000Z","size":2,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-28T20:19:43.594Z","etag":null,"topics":["golang","mountpoint","usb"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwisiswant0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"dwisiswant0","custom":["https://paypal.me/dw1s"]}},"created_at":"2021-12-21T14:36:54.000Z","updated_at":"2024-10-03T05:15:59.000Z","dependencies_parsed_at":"2022-09-08T14:32:18.839Z","dependency_job_id":null,"html_url":"https://github.com/dwisiswant0/unmountpoint","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwisiswant0%2Funmountpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwisiswant0%2Funmountpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwisiswant0%2Funmountpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwisiswant0%2Funmountpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwisiswant0","download_url":"https://codeload.github.com/dwisiswant0/unmountpoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229920733,"owners_count":18144860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","mountpoint","usb"],"created_at":"2024-10-28T20:19:30.796Z","updated_at":"2024-12-16T06:41:39.307Z","avatar_url":"https://github.com/dwisiswant0.png","language":"Go","funding_links":["https://ko-fi.com/dwisiswant0","https://paypal.me/dw1s"],"categories":[],"sub_categories":[],"readme":"# Unmountpoint\n\n**Unmountpoint** is Go library to wait for the detached/unmounted state of a path.\n\n\u003e **DISCLAIMER**: This project is under development and fully experimental mode.\n\n## Installation\n\n```console\n$ go get -v github.com/dwisiswant0/unmountpoint/pkg/unmount\n```\n\n## Usage\n\n```golang\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/dwisiswant0/unmountpoint/pkg/unmount\"\n)\n\nfunc main() {\n\tp := \"/media/dw1/USB-BUS1\" // Mountpoint path to watch\n\tc := make(chan bool, 1)\n\te := unmount.Wait(c, p)\n\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\n\tgo func() {\n\t\t\u003c-c\n\t\t// Unmounted!\n\t\t// Do stuff e.g. rm -rf /\n\n\t\tlog.Println(\"Path unmounted!\")\n\t\tos.Exit(1)\n\t}()\n\n\tlog.Printf(\"Wait for %s path to detach/unmounted...\\n\", p)\n\tfor {\n\t\ttime.Sleep(10 * time.Second)\n\t}\n}\n```\n\nBasically like [`signal.Notify`](https://pkg.go.dev/os/signal#Notify). If `/media/dw1/USB-BUS1` directory is unmounted; `Wait` assigns channel value then do some stuff _(if any)_.\n\nSee [examples](https://github.com/dwisiswant0/unmountpoint/blob/master/examples).\n\n## TODO\n\nSee `TODO`.\n\n## Acknowledgements\n\n- [BusKill](https://docs.buskill.in/buskill-app/en/stable/index.html) served as my inspiration.\n\n## License\n\n**Unmountpoint** is distributed under Apache-2.0. See `LICENSE`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwisiswant0%2Funmountpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwisiswant0%2Funmountpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwisiswant0%2Funmountpoint/lists"}