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

Question about watcher when use Zeta #40

Open
MustafaDaoud90 opened this issue Jun 15, 2022 · 0 comments
Open

Question about watcher when use Zeta #40

MustafaDaoud90 opened this issue Jun 15, 2022 · 0 comments

Comments

@MustafaDaoud90
Copy link

any idea to work on watcher events when using zeta such as:

watcher.Deleted += new System.IO.FileSystemEventHandler(OnDeleted);
watcher.Renamed += new System.IO.RenamedEventHandler(OnRenamed);

private void OnRenamed(object source, System.IO.RenamedEventArgs e)
    {
        try
        {
            
            FileSystemEvent fse;
            if (ZlpIOHelper.FileExists(e.FullPath))
            {
                fse = new FileSystemEvent(e.OldFullPath, e.FullPath, FileSystemType.FILE);
            }
            else if (ZlpIOHelper.DirectoryExists(e.FullPath))
            {
                fse = new FileSystemEvent(e.OldFullPath, e.FullPath, FileSystemType.FOLDER);
            }
            else
            {
                fse = new FileSystemEvent(e.OldFullPath, e.FullPath, FileSystemType.UNKNOWN);
            }
            FileSystemEventDispatcher.Instance.Enqueue(fse);
        }
        catch (Exception ex)
        {
            
        }
        
    }

e.OldFullPath when using a long path returns too long an exception.

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

1 participant