Skip to content

Instantly share code, notes, and snippets.

@eskye
Last active June 8, 2020 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eskye/68a5af47ae5e55edd85ec9bbe6149d39 to your computer and use it in GitHub Desktop.
Save eskye/68a5af47ae5e55edd85ec9bbe6149d39 to your computer and use it in GitHub Desktop.
GetFlureeSnapshot file
public async Task<FileObject> GetFlureeSnapshot()
{
var result = await CreateSnapshot("local/firstdb");
var files = Directory.GetFiles( @"\flureedb\data\ledger\local\testmydb\snapshot");
var file = files.FirstOrDefault(x => x.Contains(result)) ?? throw new Exception($"File does not exist");
var fileByte = await File.ReadAllBytesAsync(file);
var fileInfo = new FileInfo(file);
return new FileObject
{
File = fileByte,
FileName = fileInfo.Name
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment