Suppose a folder is on some kind of network resource to which a low access speed.
If I just try to open methods of working with the file system through standard C #, the program will move.
You can put it in a separate Task, but in that case I still can’t use the cancellationtoken, because inside Task, when I call the file system function, I won’t be able to check it.
Is kokneretno correct in this case to abort the flow? It seems like they write everywhere that it is bad ...
GetFiles
, useEnumerateFiles
. - Alexander Petrov