DescriptIon.Core
1.0.2
dotnet add package DescriptIon.Core --version 1.0.2
NuGet\Install-Package DescriptIon.Core -Version 1.0.2
<PackageReference Include="DescriptIon.Core" Version="1.0.2" />
<PackageVersion Include="DescriptIon.Core" Version="1.0.2" />
<PackageReference Include="DescriptIon.Core" />
paket add DescriptIon.Core --version 1.0.2
#r "nuget: DescriptIon.Core, 1.0.2"
#:package DescriptIon.Core@1.0.2
#addin nuget:?package=DescriptIon.Core&version=1.0.2
#tool nuget:?package=DescriptIon.Core&version=1.0.2
DescriptIon โ Cross-platform descript.ion File Reader/Writer for .NET
DescriptIon is a lightweight, cross-platform C# library for reading, writing, and managing descript.ion files used by Total Commander and Double Commander. It supports multi-line comments, filenames with spaces/quotes, automatic format detection, and advanced maintenance features (e.g., cleaning orphaned entries, natural sorting).
Mapaler: I'm new to C#, so this library was developed with AI assistance. ๐จ๐ณ Chinese users: See README_zh.md for the Chinese version.
โจ Features
- โ
Compatible with Total Commander & Double Commander
- Automatically detects and handles two different multi-line comment formats
- โ
Unified newline handling
- Internally uses
\nfor line breaks - Automatically converts to target format on save
- Internally uses
- โ
Preserves original encoding and style
- Auto-detects file encoding (UTF-8 with BOM, ANSI, etc.)
- โ
Advanced maintenance tools
- Remove orphaned entries (comments without corresponding files/directories)
- Sort entries using OS-aware rules (
CurrentCultureby default, customizable)
- โ Zero dependencies: Uses only .NET Standard libraries
๐ฆ Installation
Install the package via NuGet:
dotnet add package DescriptIon.Core
Or via Package Manager Console:
Install-Package DescriptIon.Core
Why DescriptIon.Core?
The package ID DescriptIon was used. So I uses the name DescriptIon.Core.
๐ Quick Start
1. Basic Read/Write
// Load descript.ion
var store = new DescriptionStore(@"C:\MyFolder");
store.Load();
// Get comment
string? comment = store.GetComment("report.pdf");
// Set multi-line comment (use \n)
store.SetComment("notes.txt", "Line 1\nLine 2");
// Save back to file
store.Save();
2. Advanced Maintenance
var store = new DescriptionStore(@"C:\MyFolder");
store.Load();
// Clean up comments for deleted files
store.RemoveOrphanedEntries();
// Sort by filename (default: CurrentCulture)
store.Sort();
// Or specify comparer
store.Sort(StringComparer.Ordinal);
store.Save(); // Writes a clean descript.ion
3. Helper Methods (for occasional use)
For heavy usage, prefer the full
DescriptionStoreapproach to reduce disk I/O.
// Set comment via full path
DescriptionHelper.SetComment(@"C:\Data\image.jpg", "My photo");
// Get comment
string? cmt = DescriptionHelper.GetComment(@"C:\Data\Projects\");
// Supports FileInfo / DirectoryInfo
var file = new FileInfo("log.txt");
DescriptionHelper.SetComment(file, "Application log");
๐งฉ Core API
DescriptionStore Class
| Method | Description |
|---|---|
Load() |
Loads comments from descript.ion (auto-detects format & encoding) |
Save() |
Saves to descript.ion (preserves original encoding, outputs in detected format) |
GetComment(string fileName) |
Gets comment (case-insensitive) |
SetComment(string fileName, string comment) |
Sets comment (\n for line breaks) |
RemoveComment(string fileName) |
Removes comment |
RemoveOrphanedEntries() |
Deletes entries with no matching file/directory |
Sort(IComparer<string>? comparer = null) |
Sorts entries (default: StringComparer.CurrentCulture) |
DescriptionHelper Static Class
| Method | Description |
|---|---|
GetComment(string fullPath) |
Gets comment by full path |
SetComment(string fullPath, string? comment) |
Sets comment by full path |
GetComment(FileSystemInfo item) |
Supports FileInfo / DirectoryInfo |
SetComment(FileSystemInfo item, string? comment) |
Same as above |
๐ Format Details
Total Commander Format
- Multi-line comments use
\n(stored as literal"\\n") - Line ends with marker:
EOT (U+0004) + ร (U+00C2) - Example:
"my file.txt" Line 1\\nLine 2\x04ร
Double Commander Format
- Multi-line comments joined by NO-BREAK SPACE (U+00A0)
- No extra markers
- Example:
folder My folder with two lines
๐ก The library internally uses
\nand handles format conversion automatically.
๐งฉ Third-Party Compatibility
Beyond Total Commander and Double Commander, support varies:
๐ฆ 7-Zip
- โ
Reads
descript.ionto show file comments - โ ๏ธ Only supports UTF-8 encoding (BOM optional)
- โ Does not support multi-line comments โ line breaks are ignored or truncated
- ๐ก Recommendation: Use single-line comments and UTF-8 for 7-Zip compatibility
- โ
Reads
๐ผ๏ธ XnView / XnViewMP
- โ Fully supports Total Commander format
- โ
Correctly parses multi-line comments (including
\\nand EOT+ร markers) - โ Handles filenames with spaces and quotes
- โ Auto-detects UTF-8 / ANSI encoding
- ๐ก One of the best-compatible image viewers outside Total Commander
๐ Tip: For maximum compatibility across tools, use Total Commander format + UTF-8 with BOM + single-line comments.
๐งช Test Coverage
- Filename parsing (spaces, quotes, escaping)
- Multi-line comments (TC / DC formats)
- Encoding detection (UTF-8 BOM / ANSI)
- Orphaned entry cleanup
- Sorting behavior
- Trailing slash handling in paths
๐ License
MIT License โ free for personal and commercial use.
๐ Acknowledgements
Inspired by Total Commander and Double Commander.
Bringing descript.ion to life in the .NET world!
Perfect for file manager plugins, backup tools, document organization scripts, and more.
Changelog
- v1.0.1 (2025-12-13)
- Fixed:
UnauthorizedAccessExceptionwhen updating an existingdescript.ionfile on Windows. - Removed the
DescriptIonEntryclass; now usesDictionary<string, string>internally for simpler design and better performance.
- Fixed:
- v1.0.2 (2025-12-13)
- Fixed: Newly created
descript.ionfiles were not marked as hidden. - Ensured the file is always set to hidden after write operations, matching Total Commander's behavior.
- Fixed: Newly created
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.