I don't think this is meant to happen

General APL language issues

I don't think this is meant to happen

Postby crishog on Mon Sep 05, 2016 10:29 am

'd:\tmp'⎕ncreate ¯1
'd:\tmp'⎕nerase ¯1

So far so good, but

'd:\tmp'⎕ncreate ¨¯1
⎕NINFO ¯1
d:/tmp
'd:\tmp'⎕NERASE ¯1
FILE NAME ERROR: File name mismatch
'd:\tmp'⎕NERASE ¯1

'd:/tmp'⎕NERASE ¯1

Does work

⎕NAMES also shows that the "\" has flipped to "/" after a call to ⎕NINFO
crishog
 
Posts: 61
Joined: Mon Jan 25, 2010 9:52 am

Re: I don't think this is meant to happen

Postby Dick Bowman on Mon Sep 05, 2016 10:54 am

Some weeks ago I suggested to Dyalog that it would be preferable (at least for me) if we were able to set what we wanted to use as filename separator - normalising file names through ⎕NPARTS, which seemed like a sensible thing to do, throws up a number of problems if you then try to use the filenames with other Windows components.

You can see that Dialog themselves contort code to deal with this - look at the SALTUtils namespace.

On the whole, I'd like to see filename separator either as something we can specify ourselves or as a system constant determined by checking the host OS.
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

Re: I don't think this is meant to happen

Postby Richard|Dyalog on Wed Sep 07, 2016 3:47 pm

You are quite right; it is not meant to happen. Querying the name of a tied file with ⎕NINFO is not supposed to change the name associated with it - that it apparently has done breaks ⎕NERASE as you demontrate. We will raise a bug report for this and fix it.
User avatar
Richard|Dyalog
 
Posts: 44
Joined: Thu Oct 02, 2008 11:11 am


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest