Skip to content

Commit

Permalink
add a command to test reading a file system from a file.db
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysann Schlegel committed Dec 2, 2018
1 parent 54b0121 commit adf7c14
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/AnnoRDA
28 changes: 28 additions & 0 deletions src/FileDBTool/Commands/LoadFileDBCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.IO;

using AnnoRDA.FileDB.Reader;
using AnnoRDA.FileDB.Structs;

namespace RDAExplorer.FileDBTool.Commands
{
class LoadFileDBCommand : ManyConsole.ConsoleCommand
{
public LoadFileDBCommand()
{
IsCommand("load", "Load file.db");
HasLongDescription("Load contents of a file.db.");

HasAdditionalArguments(1, " file.db");
}

public override int Run(string[] remainingArguments)
{
using (var fileStream = new FileStream(remainingArguments[0], FileMode.Open, FileAccess.Read)) {
using (var reader = new FileSystemReader(fileStream)) {
reader.ReadFileSystem();
}
}
return 0;
}
}
}

0 comments on commit adf7c14

Please sign in to comment.