{"id":16440232,"url":"https://github.com/soypat/fat","last_synced_at":"2025-10-18T06:52:49.861Z","repository":{"id":217990470,"uuid":"745298080","full_name":"soypat/fat","owner":"soypat","description":"File Allocation Table implementation (FAT32+exFAT)","archived":false,"fork":false,"pushed_at":"2024-02-20T12:34:01.000Z","size":824,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T18:04:53.652Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soypat.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-01-19T03:05:31.000Z","updated_at":"2024-05-28T18:10:27.000Z","dependencies_parsed_at":"2024-02-08T03:23:51.968Z","dependency_job_id":"5c52316c-f086-4e45-879c-c7d03d14006a","html_url":"https://github.com/soypat/fat","commit_stats":null,"previous_names":["soypat/fat"],"tags_count":0,"template":false,"template_full_name":"soypat/go-module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Ffat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Ffat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Ffat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Ffat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soypat","download_url":"https://codeload.github.com/soypat/fat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219861933,"owners_count":16555980,"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":[],"created_at":"2024-10-11T09:11:35.620Z","updated_at":"2025-10-18T06:52:44.825Z","avatar_url":"https://github.com/soypat.png","language":"Go","funding_links":[],"categories":["Embedded Systems"],"sub_categories":["General use"],"readme":"# fat\n[![go.dev reference](https://pkg.go.dev/badge/github.com/soypat/fat)](https://pkg.go.dev/github.com/soypat/fat)\n[![Go Report Card](https://goreportcard.com/badge/github.com/soypat/fat)](https://goreportcard.com/report/github.com/soypat/fat)\n[![codecov](https://codecov.io/gh/soypat/fat/branch/main/graph/badge.svg)](https://codecov.io/gh/soypat/fat)\n[![Go](https://github.com/soypat/fat/actions/workflows/go.yml/badge.svg)](https://github.com/soypat/fat/actions/workflows/go.yml)\n[![sourcegraph](https://sourcegraph.com/github.com/soypat/fat/-/badge.svg)](https://sourcegraph.com/github.com/soypat/fat?badge)\n[![License: BSD-3Clause](https://img.shields.io/badge/License-BSD-3.svg)](https://opensource.org/licenses/bsd-3-clause)\n\nA File Allocation Table implementation written in Go. Intended for use in embedded systems \nwith SD cards, USBs, MMC devices and also usable with an in-RAM representation. Inspired by [FatFs](https://github.com/abbrev/fatfs).\n\nThis is a *Work in Progress*.\n\nHow to install package with newer versions of Go (+1.16):\n```sh\ngo mod download github.com/soypat/fat@latest\n```\n\n### Basic usage example\n\nThe following example does the following:\n1. Mounts a FAT filesystem to the `fat.FS` type.\n2. Creates a new empty file called `newfile.txt`, replacing any existing file.\n3. Writes `Hello, World!` to that file.\n4. Closes the file to synchronize pending changes to the FAT filesystem.\n5. Opens the file in read mode and reads all of it's contents and prints them to standard output.\n\n```go\npackage main\n\nimport \"github.com/soypat/fat\"\n\nfunc main() {\n\t// device could be an SD card, RAM, or anything that implements the BlockDevice interface.\n\tdevice := NewFATDevice()\n\tvar fs fat.FS\n\terr := fs.Mount(device, device.BlockSize(), fat.ModeRW)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tvar file fat.File\n\terr = fs.OpenFile(\u0026file, \"newfile.txt\", fat.ModeCreateAlways|fat.ModeWrite)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t_, err = file.Write([]byte(\"Hello, World!\"))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = file.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Read back the file:\n\terr = fs.OpenFile(\u0026file, \"newfile.txt\", fat.ModeRead)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdata, err := io.ReadAll(\u0026file)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(string(data))\n\tfile.Close()\n    // Output: Hello, World!\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoypat%2Ffat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoypat%2Ffat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoypat%2Ffat/lists"}