15.06.2016, 00:20, "Doug Coleman" <doug.cole...@gmail.com>:
Methods on object work for any object, even ``f``, but any more specific type will override and get called instead. Methods on object are default methods, but the windows-specific method is worse since it blocks.
 
 
I see, that's good to know, thank you.
 
Is there a native windows api call that doesn't block, or should we just use the default copy-file?
 
There is no asynchronous CopyFile, only ReadFileEx and WriteFileEx, which, I think, the default copy-file amounts to (or maybe it's ReadFile/WriteFile with the OVERLAPPED parameter - they are effectively the same as the *Ex). That's what the IO completion ports are used for.
 
Knowing that, there is no point in having the copy-file version that calls the (synchronous) CopyFile.
 
But there is still a point in having a separate batch-processing backend. You see, if you start a copy operation in the Listener interactively, then even with the good variant of the copy-file you won't be able to continue working with the Listener until the copying is finished. Sure, it won't hang, and the caret will keep blinking, but you won't be able to queue the next file to be copied while the first one is still being handled. That's what my custom backend would do for you.
 
Another thing I'd like it to be able to do is to persist the pending operations and stop and resume them as needed across Factor runs. That's for the cases where I'd plan a file reorganization without actual access to the storage medium. Or an automated backup.
 
Yes, I have some big plans in this area.
 
So, as an experiment, I have separated some of the operations into a new dmc-backend (delete-move-copy) alongside the (lower-level) io-backend. This sort of works, although it can't be local to my vocab, as it requires an interface change in the Factor's basis.
 
Having the separate dmc-backend hooking point allows me to (temporarily) substitute the "windows" singleton with my own "batch" singleton (using with-variable), and therefore use all the higher level words that call copy-file internally, such as copy-file-into or copy-files-into, etc.
 
---=====---
Александр
 
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to