print with ampersand (&) in path or name

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

print with ampersand (&) in path or name

Gregory White

>> version

ans = 4.2.2

 

The "&" symbol is valid in Windows (w7_64) for filenames or paths. It seems to cause a crash with the print command:

 

plot(0:1,0:1),print("C:/test.eps",'-depsc')     %Octave does not crash/close

plot(0:1,0:1),print("C:/V&V/test.eps",'-depsc') % Octave does crash/close

plot(0:1,0:1),print("C:/V&Vtest.eps",'-depsc')  % Octave does crash /close

 

It doesn't seem to tolerate the "&" symbol in the filename or the path. I did some looking to see if an escape was needed for &, but did not find anything.

 

This works fine, btw:

addpath("C:/V&V/")

 

Am I doing something wrong? I looked into escapes, or whatever needed, for the & symbol, but couldn’t find any reference.

 



Reply | Threaded
Open this post in threaded view
|

Re: print with ampersand (&) in path or name

Mike Miller-4
On Thu, Mar 15, 2018 at 18:55:22 +0000, Gregory White wrote:
> It doesn't seem to tolerate the "&" symbol in the filename or the
> path. I did some looking to see if an escape was needed for &, but did
> not find anything.

Can you please file a bug report at

  https://savannah.gnu.org/bugs/?func=additem&group=octave

This should work. This does work for me on a GNU/Linux system, so may be
something with the way external commands are called when printing to a
file on Windows.

Btw, it seems obvious to me that I would want to avoid any file or
directory names that have '&' in them, but this may not be obvious to
everyone, and I do think Octave should support this.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: print with ampersand (&) in path or name

Gregory White

>-----Original Message-----
>From: Mike Miller [mailto:[hidden email]]
>Sent: Thursday, March 15, 2018 2:49 PM
>To: Gregory White <[hidden email]>
>Cc: [hidden email]
>Subject: Re: print with ampersand (&) in path or name
>
>On Thu, Mar 15, 2018 at 18:55:22 +0000, Gregory White wrote:
>> It doesn't seem to tolerate the "&" symbol in the filename or the
>> path. I did some looking to see if an escape was needed for &, but did
>> not find anything.
>
>Can you please file a bug report at
>
>  https://savannah.gnu.org/bugs/?func=additem&group=octave

I will do that.

>This should work. This does work for me on a GNU/Linux system, so may be something with the way external commands are called when printing to a file on Windows.
>
>Btw, it seems obvious to me that I would want to avoid any file or directory names that have '&' in them, but this may not be obvious to everyone, and I do think Octave should support this.

I don't like use of the ampersand for these things, but... getting people to not use R&D, V&V, or simile is already a lost battle. :-(


Thank you,
Greg