Hello, Doug!
I'm a bit confused, because I found this code:
IN: io.directories.windows
M: windows copy-file ( from to -- )
dup parent-directory make-directories
[ normalize-path ] bi@ 0 CopyFile win32-error=0/f ;
This code defines copy-file as a method on "windows", and the code you quoted below defines copy-file as a method on "object".
In what circumstances io-backend will have an instance of an "object" (instead of windows, unix, etc.) so that the code you quoted is actually executed?
Is it the default implementation in case "windows" has no "copy-file" method?
14.06.2016, 22:37, "Doug Coleman" <doug.cole...@gmail.com>:
Hey Alexander,We have a copy-file implemented with stream-copy already. It's non-blocking and it might be fast enough, or we could optimize it. I haven't looked at CopyFile for a long time, but maybe we shouldn't use that and should use the default stream-copy version instead. Then you don't have to replace the io-backend with a different one.Doug! From basis/io/directories/directories.factorIN: io.directories! Copying filesHOOK: copy-file io-backend ( from to -- ) ;M: object copy-filedup parent-directory make-directoriesbinary <file-writer> [swap binary <file-reader> [swap stream-copy] with-disposal] with-disposal ;
---=====---
Александр
------------------------------------------------------------------------------ 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