Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress #299

Open
modz4567 opened this issue Apr 28, 2024 · 5 comments
Open

Progress #299

modz4567 opened this issue Apr 28, 2024 · 5 comments

Comments

@modz4567
Copy link

Hi I was wondering if you were going to add to add the progress of showing the files and folders being added when the iso is being created please

@LTRData
Copy link

LTRData commented Apr 28, 2024

You mean the ISOCreate command line tool? I agree that would be useful. I will consider it next time I do something with the command line tools.

@modz4567
Copy link
Author

I have updated it myself should I create a push also I'm trying to look for in the code where to increase rhe speed of creating a iso image

@LTRData
Copy link

LTRData commented Apr 29, 2024

If you create a pull request in my fork at https://github.com/LTRData/DiscUtils I can take a look and merge it when it looks okay!

Also, my fork has a lot of performance improvements in general, so it is a better starting point if you want to make it faster. I think there could potentially be many more ways performance could be improved for ISO builder if we look deeper into it.

@modz4567
Copy link
Author

Well basically when adding files to the iso it takes some time maybe 4mins to create a 9gb iso

@modz2014
Copy link

example here @LTRData

public event ProgressHandler ProgressChanged;

private void UpdateProgress(int currentProgress, int totalItems)
{
    this.ProgressChanged?.Invoke(currentProgress, totalItems);
}
public BuildFileInfo AddFile(string name, byte[] content)
{
    string[] array = name.Split(new char[1] { '\\' }, StringSplitOptions.RemoveEmptyEntries);
    BuildDirectoryInfo directory = GetDirectory(array, array.Length - 1, createMissing: true);
    if (directory.TryGetMember(array[array.Length - 1], out var _))
    {
        throw new IOException("File already exists");
    }

    BuildFileInfo buildFileInfo = new BuildFileInfo(array[array.Length - 1], directory, content);
    _files.Add(buildFileInfo);
    directory.Add(buildFileInfo);
    UpdateProgress(_files.Count, _files.Count + _dirs.Count);
    return buildFileInfo;
}
 public BuildFileInfo AddFile(string name, string sourcePath)
 {
     string[] array = name.Split(new char[1] { '\\' }, StringSplitOptions.RemoveEmptyEntries);
     BuildDirectoryInfo directory = GetDirectory(array, array.Length - 1, createMissing: true);
     if (directory.TryGetMember(array[array.Length - 1], out var _))
     {
         throw new IOException("File already exists");
     }

     BuildFileInfo buildFileInfo = new BuildFileInfo(array[array.Length - 1], directory, sourcePath);
     _files.Add(buildFileInfo);
     directory.Add(buildFileInfo);
     UpdateProgress(_files.Count, _files.Count + _dirs.Count);
     return buildFileInfo;
 }
public BuildFileInfo AddFile(string name, Stream source)
{
    if (!source.CanSeek)
    {
        throw new ArgumentException("source doesn't support seeking", "source");
    }

    string[] array = name.Split(new char[1] { '\\' }, StringSplitOptions.RemoveEmptyEntries);
    BuildDirectoryInfo directory = GetDirectory(array, array.Length - 1, createMissing: true);
    if (directory.TryGetMember(array[array.Length - 1], out var _))
    {
        throw new IOException("File already exists");
    }

    BuildFileInfo buildFileInfo = new BuildFileInfo(array[array.Length - 1], directory, source);
    _files.Add(buildFileInfo);
    directory.Add(buildFileInfo);
    UpdateProgress(_files.Count, _files.Count + _dirs.Count);
    return buildFileInfo;
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants