{"id":38090512,"url":"https://github.com/brk0v/directio","last_synced_at":"2026-01-16T20:57:14.206Z","repository":{"id":57493309,"uuid":"171758596","full_name":"brk0v/directio","owner":"brk0v","description":"Direct IO Golang Writer (Linux O_DIRECT)","archived":false,"fork":false,"pushed_at":"2024-11-05T17:26:41.000Z","size":16,"stargazers_count":41,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-05T18:32:38.060Z","etag":null,"topics":["direct","directio","io","o-direct","pagecache"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brk0v.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-20T22:22:50.000Z","updated_at":"2024-11-05T17:26:53.000Z","dependencies_parsed_at":"2022-08-28T11:23:31.033Z","dependency_job_id":null,"html_url":"https://github.com/brk0v/directio","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brk0v/directio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brk0v%2Fdirectio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brk0v%2Fdirectio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brk0v%2Fdirectio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brk0v%2Fdirectio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brk0v","download_url":"https://codeload.github.com/brk0v/directio/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brk0v%2Fdirectio/sbom","scorecard":{"id":254167,"data":{"date":"2025-08-11","repo":{"name":"github.com/brk0v/directio","commit":"ae9d82eb8fee359469baae4b7feb1ec8178e482d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 2/9 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T09:12:33.697Z","repository_id":57493309,"created_at":"2025-08-17T09:12:33.697Z","updated_at":"2025-08-17T09:12:33.697Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["direct","directio","io","o-direct","pagecache"],"created_at":"2026-01-16T20:57:14.108Z","updated_at":"2026-01-16T20:57:14.195Z","avatar_url":"https://github.com/brk0v.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Direct IO Writer\n\nDirect IO writer using O_DIRECT\n\n\u003e [!WARNING]\n\u003e `/tmp/` in modern systems doesn't supoprt Direct I/O, for tests use `/var/tmp` instead.\n\nExample:\n\n```go\npackage main\n\nimport (\n    \"io\"\n    \"log\"\n    \"net/http\"\n    \"os\"\n    \"syscall\"\n\n    \"github.com/brk0v/directio\"\n)\n\nfunc main() {\n    // Open file with O_DIRECT\n    flags := os.O_WRONLY | os.O_EXCL | os.O_CREATE | syscall.O_DIRECT\n    f, err := os.OpenFile(\"/var/tmp/mini.iso\", flags, 0644)\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer f.Close()\n\n    // Use directio writer\n    dio, err := directio.New(f)\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer dio.Flush()\n\n    // Downloading iso image\n    resp, err := http.Get(\"http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    defer resp.Body.Close()\n\n    // Write the body to file\n    _, err = io.Copy(dio, resp.Body)\n}\n\n```\n\nCheck that dio bypass linux pagecache using `vmtouch`:\n\n```bash\n$ vmtouch /var/tmp/mini.iso\n           Files: 1\n     Directories: 0\n  Resident Pages: 1/16384  4K/64M  0.0061%\n         Elapsed: 0.000356 seconds\n```\n\nor using my `https://github.com/brk0v/cpager` to check per cgroup pagecache usage:\n\n```bash\n$ sudo ~/go/bin/cpager /var/tmp/mini.iso\n         Files: 1\n   Directories: 0\nResident Pages: 1/16385 4K/64M 0.0%\n\n cgmem inode    percent       pages        path\n           -     100.0%       16384        not charged\n        2187       0.0%           1        /sys/fs/cgroup/memory/user.slice/user-1000.slice/session-3.scope\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrk0v%2Fdirectio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrk0v%2Fdirectio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrk0v%2Fdirectio/lists"}