This works OK for me (in Windows): NB.* fcopy: copy x (fully-pathed name of file) to y. fcopy=: 4 : 'shell (''copy "'',x,''" "'',y,''"'') rplc ''/\''' NB.EG 'C:\Temp\foo.txt' fcopy 'E:\Perm\foo2.txt'
I just noticed I had a commented-out version of "fcopy" using the win32api with 'CopyFileA', so presumably that worked at some point in the past. On Wed, Feb 12, 2020 at 9:36 PM bill lam <bbill....@gmail.com> wrote: > I had checked there is no CopyFileA in j901 base library > and addons (except jod). > > Thu, 13 Feb 2020, bill lam написал(а): > > CopyFileA doesn't work for utf8 or unicode. I'll check. > > > > On Thu, Feb 13, 2020, 7:06 AM Julian Fondren <jfond...@minimaltype.com> > > wrote: > > > > > On 2020-02-12 16:50, Devon McCormick wrote: > > > > Is there, or did there used to be, a file copy command called > "fcopy"? > > > > I > > > > see it in some old code but cannot find its definition. > > > > > > > > Thanks, > > > > Devon > > > > > > In git history I see references to an fcopyto that seemed to be > > > Windows only, defined in terms of CopyFileA > > > > > > Fcopyto =: >@{.@('kernel32 CopyFileA i *c *c i' &(15!:0)) > > > fcopyto =: 4 : 'Fcopyto x,y,<0' > > > > > > There's also an fcopynew in stdlib, which reads the source and > > > the destination and only writes to the destination when the > > > reads differ. > > > > > > https://code.jsoftware.com/wiki/Standard_Library/files#fcopynew > > > > > > There's also an fcopy in general/dirtrees: > > > > > > fcopy=: fwrite~ fread > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > -- > regards, > ==================================================== > GPG key 1024D/4434BAB3 2008-08-24 > gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3 > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA Quantitative Consultant ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm