require'task misc dir'

  fexpcopy=: 4 : 0
DIRRX=: x,'\'
DIRRY=:(1!:43''),'\',y,'\'
a=. 1 dir x
fexpcop &. > a
)

  fexpcop=: 3 : 0
a=.y
b=. '\' chop a
c=.>{:b
smoutput 'copy "',y,'" "',DIRRY,c,'"'
shell 'copy "',y,'" "',DIRRY,c,'"'
)

  styrir=: 3 : 0
wdstatus 'exp'
 'C:\CTDI\mars2007\UNFORS'  fexpcopy  'user\CTDI\UNFORS'
)

  styrir''
copy "C:\CTDI\mars2007\UNFORS\ctdi mælingar.xml"
"c:\j601\user\CTDI\UNFORS\ctdi mælingar.xml"
┌────────────────────────────────────────────┐
│The system cannot find the file specified.  │
└────────────────────────────────────────────┘


NB. I copy and paste the copy line here above to a cmd window


C:\Documents and Settings\bjorn>copy "C:\CTDI\mars2007\UNFORS\ctdi
mælingar.xml"
"c:\j601\user\CTDI\UNFORS\ctdi mælingar.xml"
       1 file(s) copied.

NB. The file copies ok

NB. if I change the filename and use "a" instead of "æ"

  a. i. 'æ'
195 166

    styrir''
copy "C:\CTDI\mars2007\UNFORS\ctdi malingar.xml"
"c:\j601\user\CTDI\UNFORS\ctdi malingar.xml"
┌───────────────────────────┐
│        1 file(s) copied.  │
└───────────────────────────┘

I am not surprised that Íslandish chars are causing problems like this.

I am a bit surprised that a letter in a filename dir picks up from the
system and shell then tries to execute will cause a failure when the system
itself has no problems with it.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to