kdb/q on windows

415 views
Skip to first unread message

Sam

unread,
Oct 10, 2012, 10:29:59 PM10/10/12
to personal...@googlegroups.com
I am having a ton of issues with respect to  file paths while running my programs with Q. Apparently even on Windows, Q expect the path to be delimited by "/". So I run into issues when I extract my environment  variables from within Q programs as it is not happy with the windows "\" path separator. This causes problems in interaction between windows batch scripts and Q programs. I end up repeating my variables in batch and in Q. Is there a better solution to this issue? It is a bit annoying.

thanks

Rory O'Rorke

unread,
Oct 10, 2012, 11:30:24 PM10/10/12
to personal...@googlegroups.com
Hi Sam,
You could try something like this for your file path calls in windows to change the delimter.

q)system "chdir"
"C:\\Users\\Rory"

q)ssr[first system "chdir";"\\";"/"]
"C:/Users/Rory"

q)hsym `$ssr[first system "chdir";"\\";"/"]
`:C:/Users/Rory

Thanks Rory

On Thu, Oct 11, 2012 at 11:29 AM, Sam <jain....@gmail.com> wrote:
I am having a ton of issues with respect to  file paths while running my programs with Q. Apparently even on Windows, Q expect the path to be delimited by "/". So I run into issues when I extract my environment  variables from within Q programs as it is not happy with the windows "\" path separator. This causes problems in interaction between windows batch scripts and Q programs. I end up repeating my variables in batch and in Q. Is there a better solution to this issue? It is a bit annoying.

thanks

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/personal-kdbplus/-/4JcyLKEF43cJ.
To post to this group, send email to personal...@googlegroups.com.
To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.

Sam

unread,
Oct 11, 2012, 6:44:46 PM10/11/12
to personal...@googlegroups.com, rory....@googlemail.com
Cool thanks. 
p:{hsym `$ssr[x;"\\";"/"]}

q)getenv `KDBHOME
"C:\\kdb\\metrics"
q)pconvert:{hsym `$ssr[x;"\\";"/"]}
q)pconvert getenv `KDBHOME
`:C:/kdb/metrics
Reply all
Reply to author
Forward
0 new messages