aspnet / StaticFiles

[Archived] Middleware for handling requests for file system resources including files and directories. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
114 stars 72 forks source link

ChangeTokens and signalling Deleted files #162

Closed dazinator closed 8 years ago

dazinator commented 8 years ago

Hello,

In my custom IFileProvider, i'd like it to behave correctly when a file being watched is deleted. I already have it returning a custom IChangeToken for the watched file, but i'm not clear on exactly what needs to be done in order to correctly signal a Delete. Are there any examples of this that I could look at? Is it just as simple as passing Null when raising the callbacks - i.e:

                     myChangeToken .HasChanged = true;
                    myChangeToken.RaiseCallback(null);

Where all RaiseCallback does is loop through the subscribed listners and invoke them passing the specified argument - which usually would be the updated file, but in this case as the file is deleted, I guess I would need to set it to null?

Tratcher commented 8 years ago

This issue was moved to aspnet/FileSystem#241

dazinator commented 8 years ago

oops sorry wrong repo! That will teach me to have too many github pages open at once.