Skip to content

DirectoryFiles-Storage leaves behind orphaned .attr files #144

Description

@MBatWork

Error description

The DirectoryFiles provider automatically creates .attr files when additional properties are stored for a BLOB. So far, so familiar.

However, these .attr files are not deleted when the associated BLOB is removed.

Demo code

using FluentStorage;
using FluentStorage.Blobs;

using IBlobStorage storage = StorageFactory.Blobs.DirectoryFiles("Storage");

await storage.WriteAsync("/Demo.dat", "Demo"u8.ToArray(), append: false);
Blob blob = await storage.GetBlobAsync("/Demo.dat");
blob.Properties["ContentType"] = "text/plain";

await storage.SetBlobsAsync([blob]);

await storage.DeleteAsync([blob]);

After running the source code above, a file named Demo.dat.attr remains in the storage folder, while the main file, Demo.dat, has been deleted as expected.

Expected behavior

If FluentStorage automatically creates an attribute file to store additional information, that file should also be automatically deleted after the primary BLOB is removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions