{"id":18937525,"url":"https://github.com/verifytests/emptyfiles","last_synced_at":"2025-05-16T08:04:50.518Z","repository":{"id":42576022,"uuid":"230589486","full_name":"VerifyTests/EmptyFiles","owner":"VerifyTests","description":"A collection of minimal binary files.","archived":false,"fork":false,"pushed_at":"2025-05-14T10:35:48.000Z","size":546,"stargazers_count":52,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-16T08:04:42.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/VerifyTests.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.txt","code_of_conduct":"code_of_conduct.md","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},"funding":{"github":"VerifyTests"}},"created_at":"2019-12-28T09:38:40.000Z","updated_at":"2025-05-14T10:35:51.000Z","dependencies_parsed_at":"2023-11-13T09:28:15.837Z","dependency_job_id":"10ed2a99-544e-4dc6-ac62-198eddf0f1a8","html_url":"https://github.com/VerifyTests/EmptyFiles","commit_stats":{"total_commits":329,"total_committers":8,"mean_commits":41.125,"dds":"0.29179331306990886","last_synced_commit":"8fca7de954522d7df469177ee38c3c4119a07422"},"previous_names":["simoncropp/emptyfiles"],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FEmptyFiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FEmptyFiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FEmptyFiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerifyTests%2FEmptyFiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VerifyTests","download_url":"https://codeload.github.com/VerifyTests/EmptyFiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"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-11-08T12:11:32.345Z","updated_at":"2025-05-16T08:04:45.507Z","avatar_url":"https://github.com/VerifyTests.png","language":"C#","funding_links":["https://github.com/sponsors/VerifyTests"],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"/src/icon.png\" height=\"30px\"\u003e EmptyFiles\n\n[![Discussions](https://img.shields.io/badge/Verify-Discussions-yellow?svg=true\u0026label=)](https://github.com/orgs/VerifyTests/discussions)\n[![Build status](https://ci.appveyor.com/api/projects/status/4mrhpal9rwtqajws/branch/main?svg=true)](https://ci.appveyor.com/project/SimonCropp/EmptyFiles)\n[![NuGet Status](https://img.shields.io/nuget/v/EmptyFiles.svg?label=EmptyFiles)](https://www.nuget.org/packages/EmptyFiles/)\n[![NuGet Status](https://img.shields.io/nuget/v/EmptyFiles.Tool.svg?label=dotnet%20tool)](https://www.nuget.org/packages/EmptyFiles.Tool/)\n\nA collection of minimal binary files.\n\n**See [Milestones](../../milestones?state=closed) for release notes.**\n\n\n## NuGet package\n\n * https://nuget.org/packages/EmptyFiles/\n * https://nuget.org/packages/EmptyFiles.Tool/\n\n\n## Files\n\nAll files: https://github.com/VerifyTests/EmptyFiles/tree/main/files\n\n\u003c!-- include: extensions. path: /src/extensions.include.md --\u003e\n### Archive\n\n  * .7z (32 bytes)\n  * .7zip (32 bytes)\n  * .bz2 (14 bytes)\n  * .bzip2 (14 bytes)\n  * .gz (29 bytes)\n  * .gzip (29 bytes)\n  * .tar (1.5 KB)\n  * .xz (32 bytes)\n  * .zip (22 bytes)\n\n### Document\n\n  * .docx (1.9 KB)\n  * .odt (2.2 KB)\n  * .pdf (280 bytes)\n  * .rtf (6 bytes)\n\n### Image\n\n  * .avif (298 bytes)\n  * .bmp (58 bytes)\n  * .dds (136 bytes)\n  * .dib (58 bytes)\n  * .emf (620 bytes)\n  * .exif (734 bytes)\n  * .gif (799 bytes)\n  * .heic (3.2 KB)\n  * .heif (209 bytes)\n  * .ico (70 bytes)\n  * .j2c (270 bytes)\n  * .jfif (734 bytes)\n  * .jp2 (354 bytes)\n  * .jpc (270 bytes)\n  * .jpe (734 bytes)\n  * .jpeg (734 bytes)\n  * .jpg (734 bytes)\n  * .jxr (300 bytes)\n  * .pbm (8 bytes)\n  * .pcx (131 bytes)\n  * .pgm (12 bytes)\n  * .png (119 bytes)\n  * .ppm (14 bytes)\n  * .rle (58 bytes)\n  * .tga (543 bytes)\n  * .tif (250 bytes)\n  * .tiff (250 bytes)\n  * .wdp (300 bytes)\n  * .webp (228 bytes)\n  * .wmp (300 bytes)\n\n### Sheet\n\n  * .ods (2.7 KB)\n  * .xlsx (4.5 KB)\n\n### Slide\n\n  * .odp (7.8 KB)\n  * .pptx (13.3 KB)\u003c!-- endInclude --\u003e\n\n\n## Consuming files as a web resource\n\nFiles can be consumed as a web resource using the following url:\n\n```\nhttps://github.com/VerifyTests/EmptyFiles/raw/main/index/empty.{extension}\n```\n\nSo for example to consume a jpg use\n\n```\nhttps://github.com/VerifyTests/EmptyFiles/raw/main/index/empty.jpg\n```\n\nA 404 will result for non-existent files.\n\n\n## Tool Usage\n\n\n### Installation\n\nEnsure [dotnet CLI is installed](https://docs.microsoft.com/en-us/dotnet/core/tools/).\n\nInstall [EmptyFiles.Tool](https://nuget.org/packages/EmptyFiles.Tool/)\n\n```ps\ndotnet tool install -g EmptyFiles.Tool\n```\n\n\n### Extension only Usage\n\n```\nemptyfile bmp\n```\n\nCreates `{CurrentDirectory}/empty.bmp`\n\n\n### File Usage\n\n```\nemptyfile myfile.bmp\n```\n\nCreates `{CurrentDirectory}/myfile.bmp`\n\n\n### Path Usage\n\n```\nemptyfile path/myfile.bmp\n```\n\nCreates `path/myfile.bmp`\n\n\n## Library Usage\n\n\n### CreateFile\n\nCreates a new empty file\n\n\u003c!-- snippet: CreateFile --\u003e\n\u003ca id='snippet-CreateFile'\u003e\u003c/a\u003e\n```cs\nAllFiles.CreateFile(pathOfFileToCreate);\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.cs#L136-L140' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-CreateFile' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\nThrows an exception if the extension is not known. There is also a `TryCreateFile` that will return false if the extension is not known.\n\nUse the optional `useEmptyStringForTextFiles` to create a empty text file if the extension is text. The file will be UTF8 no BOM as per https://www.unicode.org/versions/Unicode5.0.0/ch02.pdf \"Use of a BOM is neither required nor recommended for UTF-8\".\n\n\n### GetPathFor\n\nGets the path to an empty file for a given extension\n\n\u003c!-- snippet: GetPathFor --\u003e\n\u003ca id='snippet-GetPathFor'\u003e\u003c/a\u003e\n```cs\nvar path = AllFiles.GetPathFor(\".jpg\");\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.cs#L116-L120' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-GetPathFor' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\nThrows an exception if the extension is not known. There is also a `TryGetPathFor` that will return false if the extension is not known.\n\n\n### IsEmptyFile\n\nReturns true if the target file is an empty file.\n\n\u003c!-- snippet: IsEmptyFile --\u003e\n\u003ca id='snippet-IsEmptyFile'\u003e\u003c/a\u003e\n```cs\nvar path = AllFiles.GetPathFor(\".jpg\");\nTrue(AllFiles.IsEmptyFile(path));\nvar temp = Path.GetTempFileName();\nFalse(AllFiles.IsEmptyFile(temp));\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.cs#L165-L172' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-IsEmptyFile' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n### AllPaths\n\nEnumerates all empty files\n\n\u003c!-- snippet: AllPaths --\u003e\n\u003ca id='snippet-AllPaths'\u003e\u003c/a\u003e\n```cs\nforeach (var path in AllFiles.AllPaths)\n{\n    Trace.WriteLine(path);\n}\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.cs#L182-L189' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-AllPaths' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n### UseFile\n\nUse or replace a file\n\n\u003c!-- snippet: UseFile --\u003e\n\u003ca id='snippet-UseFile'\u003e\u003c/a\u003e\n```cs\nAllFiles.UseFile(Category.Document, pathToFile);\nIsTrue(AllFiles.DocumentPaths.Contains(pathToFile));\n```\n\u003csup\u003e\u003ca href='/src/Tests/Tests.cs#L202-L207' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-UseFile' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n### Extensions helper\n\n\n#### IsText\n\nhttps://github.com/sindresorhus/text-extensions/blob/master/text-extensions.json\n\n\u003c!-- snippet: IsText --\u003e\n\u003ca id='snippet-IsText'\u003e\u003c/a\u003e\n```cs\nTrue(FileExtensions.IsTextFile(\"file.txt\"));\nFalse(FileExtensions.IsTextFile(\"file.bin\"));\nTrue(FileExtensions.IsTextExtension(\".txt\"));\nFalse(FileExtensions.IsTextExtension(\".bin\"));\nTrue(FileExtensions.IsTextExtension(\"txt\"));\nFalse(FileExtensions.IsTextExtension(\"bin\"));\n```\n\u003csup\u003e\u003ca href='/src/Tests/ExtensionsTests.cs#L6-L15' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-IsText' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n#### AddTextExtension\n\n\u003c!-- snippet: AddTextExtension --\u003e\n\u003ca id='snippet-AddTextExtension'\u003e\u003c/a\u003e\n```cs\nFileExtensions.AddTextExtension(\".ext1\");\nTrue(FileExtensions.IsTextExtension(\".ext1\"));\nTrue(FileExtensions.IsTextFile(\"file.ext1\"));\n```\n\u003csup\u003e\u003ca href='/src/Tests/ExtensionsTests.cs#L36-L42' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-AddTextExtension' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n#### RemoveTextExtension\n\n\u003c!-- snippet: RemoveTextExtension --\u003e\n\u003ca id='snippet-RemoveTextExtension'\u003e\u003c/a\u003e\n```cs\nFileExtensions.AddTextExtension(\".ext1\");\nTrue(FileExtensions.IsTextExtension(\".ext1\"));\nFileExtensions.RemoveTextExtension(\".ext1\");\nFalse(FileExtensions.IsTextExtension(\".ext1\"));\n```\n\u003csup\u003e\u003ca href='/src/Tests/ExtensionsTests.cs#L52-L59' title='Snippet source file'\u003esnippet source\u003c/a\u003e | \u003ca href='#snippet-RemoveTextExtension' title='Start of snippet'\u003eanchor\u003c/a\u003e\u003c/sup\u003e\n\u003c!-- endSnippet --\u003e\n\n\n## Icon\n\n[Hollow](https://thenounproject.com/term/hollow/51835/) designed by [Michael Senkow](https://thenounproject.com/mhsenkow/) from [The Noun Project](https://thenounproject.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifytests%2Femptyfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverifytests%2Femptyfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverifytests%2Femptyfiles/lists"}