{"id":19092611,"url":"https://github.com/steffest/adf-reader-writer","last_synced_at":"2025-10-31T09:51:14.324Z","repository":{"id":70791150,"uuid":"87210508","full_name":"steffest/ADF-reader-writer","owner":"steffest","description":"Read, write and extract files from/to Amiga Disk Format (*.adf) files in plain javascript","archived":false,"fork":false,"pushed_at":"2025-05-25T19:04:03.000Z","size":1137,"stargazers_count":38,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-25T19:39:55.953Z","etag":null,"topics":["amiga","retrocomputing"],"latest_commit_sha":null,"homepage":"http://www.stef.be/adfviewer","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steffest.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-04T16:30:48.000Z","updated_at":"2025-05-25T19:04:07.000Z","dependencies_parsed_at":"2025-04-18T14:00:38.706Z","dependency_job_id":"93f63d81-2b85-4f72-a406-8727633f31ab","html_url":"https://github.com/steffest/ADF-reader-writer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steffest/ADF-reader-writer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffest%2FADF-reader-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffest%2FADF-reader-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffest%2FADF-reader-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffest%2FADF-reader-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steffest","download_url":"https://codeload.github.com/steffest/ADF-reader-writer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steffest%2FADF-reader-writer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281969175,"owners_count":26591719,"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","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["amiga","retrocomputing"],"created_at":"2024-11-09T03:21:01.911Z","updated_at":"2025-10-31T09:51:14.317Z","avatar_url":"https://github.com/steffest.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ADF reader/writer\nThis is an implementation of the Amiga Filesystem in plain javascript.  \nIt can be used to read, extract and write files from/to Amiga Disk Format (*.adf and *.hdf) files.\n\n\nBoth Original (OFS) and Fast File System (FFS) are supported in both ADF floppy disk images and HDF hard disk images.\nHard disk images with multiple partitions are not supported yet.\n\nThe main module is [adf.js](https://github.com/steffest/ADF-reader/blob/master/script/adf.js)  \nIt uses a binary file wrapper at [file.js](https://github.com/steffest/ADF-reader/blob/master/script/file.js) for easy parsing binary data.\n\nThe rest of the package is a small demo, providing a simple user interface to \n - browse the disk\n - extract/view files\n - create folders and files\nLive demo at [http://www.stef.be/adfviewer/](http://www.stef.be/adfviewer/)\n\nIt can disregard all block checksums and file attributes, which makes it quite useful to salvage files from corrupt disks.\nFor further digging, you can also extract raw sectors for reconstructing deleted files etc.  \n\nI mainly wrote it to quickly inspect .adf files for Amiga music tracker files or [Emerald Mine disks](http://www.emeraldmines.net/) without the need to fire up an Amiga Emulator.  \nBasic writing support was added for interaction with the [Scripted Amiga Emulator](https://github.com/naTmeg/ScriptedAmigaEmulator)\n\n### Main API:\n\n#### adf.loadDisk(source)\n\u003e Loads a disk from an adf or hdf file. When source is a string, it's considered as a URI, otherwise you can pass an ArrayBuffer.  \n\u003e All future actions will be done on this disk.\n\n#### adf.getInfo()\n\u003e Returns some basic info on the disk.\n\n#### adf.getFreeSize()\n\u003e Returns the used and free space of the disk (in blocks and bytes).\n\n#### adf.readRootFolder()\n\u003e Returns the files and directories of the root folder of the disk.  \n\u003e Each file and folder has a *sector* parameters which points to the start sector of the file or folder.\n\n#### adf.readFolderAtSector(sector)\n\u003e Returns the files and directories of a specific folder that starts at *sector*.  \n\u003e The starting sector is usually obtained from listing the root folder.  \n\u003e Each file and folder has a *sector* parameters which points to the start sector of the file or folder.  \n\u003e Each file and folder also has a *parent* parameter indicating the parent folder so you can traverse back up.\n\n#### adf.readFileAtSector(sector,includeContent)\n\u003e Returns the file info (and optional content) of the file starting at *sector*  \n\u003e The starting sector is usually obtained from listing a folder.  \n\u003e If *includeContent* is true then the *content* parameter contains the binary content of the file.\n\n#### adf.writeFile(name,buffer,folderSector)\n\u003e Creates a new file into a specific folder.  \n\u003e It returns the sector of the new file on succes or *False* on failure. (e.g. because diskspace is insufficient)\n\u003e Buffer is an ArrayBuffer with the binary content\n\u003e Sequential datablocks are used as much as possible to speed up reading on an actual (or emulated) Amiga.\" \n\n#### adf.deleteFileAtSector(sector)\n\u003e Deletes a file  \n\u003e Just as on the Amiga only the entry of the file in its folder is removed, all the header and datablocks are left intact,\n\u003e so it's possible to reconstruct the file as long as no new data is written to the disk. \n\n#### adf.createFolder(name,folderSector)\n\u003e Creates a folder.  \n\u003e it returns the sector of the new folder  \n\n#### adf.deleteFolderAtSector(sector)\n\u003e Deletes a folder\n\u003e Please note that the folder must me empty so for recursive deletion you should first list the folder,\n\u003e then delete all files and finally delete the folder  \n\n#### adf.renameFileOrFolderAtSector(sector,newname)\n\u003e Renames a file or a folder.  \n\u003e the maximum length of a name is 30 chars.  \n\u003e the characters / and : are not allowed  \n\n\n### additional API\nThe following methods are available for low level disk reading  \n\n#### readSector(sector)\n\u003e Returns a raw sector from the disk.  \n\u003e A sector of a standard Amiga is 512 bytes\n\n#### getSectorType(sector)\n\u003e Returns the type of the sector (headerBlock, dataBlock, extentionBlock, ...)\n\n#### readHeaderBlock(sector)\n\u003e Returns a parsed headerBlock\n\n#### readDataBlock(sector)\n\u003e Returns a parsed dataBlock\n\n#### readExtensionBlock(sector)\n\u003e Returns a parsed extentionBlock\n\n#### readBitmapblock(sector)\n\u003e Returns a parsed bitmapBlock\n\n#### readBitmapExtensionBlock(sector)\n\u003e Returns a parsed extended bitmapBlock\n\n#### getDisk()\n\u003e Returns the current disk structure. the \"buffer\" property contains the binary data of the disk\n\n### Notes\n**Writing support is still a bit experimental**.   \nDon't use it for important stuff, it certainly is **not** production ready.  \nWhen writing, all dates are ignore for the time being, so \"last changed\" and \"last accessed\" dates will not be updated.  \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffest%2Fadf-reader-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteffest%2Fadf-reader-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteffest%2Fadf-reader-writer/lists"}