Windows, drives, and Machine.add
![](https://secure.gravatar.com/avatar/98afc1a21e027f3d9707d440ff8874a3.jpg?s=120&d=mm&r=g)
Have any ChucK windows users figured out how to accomplish Machine.add with a fully-qualified path name that includes the drive letter? Machine.add("C:/Users/rebecca/tmp.ck") results in error "[C]: no such file or directory" and Machine.add("C\:/Users/rebecca/tmp.ck") results in error [tmp2.ck]:line(2): unrecognized escape sequence '\:' I know you can leave off the C: entirely and it will work, but my concern is the situation where different files to be added live on different drives. Thoughts? Thanks! Rebecca
![](https://secure.gravatar.com/avatar/9b26cb404fe1fdae235e476c55fb2cdd.jpg?s=120&d=mm&r=g)
Have you tried C:\\Users\\rebecca\\.tmp.ck?
I'm guessing \ is an escape character, so \\ would be a literal backslash.
Just a guess though since I'm a Mac user.
-Mat
On Fri, Oct 15, 2010 at 10:05 AM, Rebecca Fiebrink
Have any ChucK windows users figured out how to accomplish Machine.add with a fully-qualified path name that includes the drive letter?
Machine.add("C:/Users/rebecca/tmp.ck") results in error "[C]: no such file or directory"
and Machine.add("C\:/Users/rebecca/tmp.ck") results in error [tmp2.ck]:line(2): unrecognized escape sequence '\:'
I know you can leave off the C: entirely and it will work, but my concern is the situation where different files to be added live on different drives. Thoughts?
Thanks! Rebecca _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
![](https://secure.gravatar.com/avatar/3e272983f4cd42ff331b28d7ed269469.jpg?s=120&d=mm&r=g)
Another guess, based on what my programs look like when I run SAS on a PC.
Where you're using a forward slash, I use a back slash. For example:
"m:\sample\705615\input\file1.txt"
all single slashes.
Good luck. Best, Laurie
On Fri, Oct 15, 2010 at 10:05 AM, Rebecca Fiebrink
Have any ChucK windows users figured out how to accomplish Machine.add with a fully-qualified path name that includes the drive letter?
Machine.add("C:/Users/rebecca/tmp.ck") results in error "[C]: no such file or directory"
and Machine.add("C\:/Users/rebecca/tmp.ck") results in error [tmp2.ck]:line(2): unrecognized escape sequence '\:'
I know you can leave off the C: entirely and it will work, but my concern is the situation where different files to be added live on different drives. Thoughts?
Thanks! Rebecca _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
![](https://secure.gravatar.com/avatar/2b60d2eb2785e98d541856225d6fbd51.jpg?s=120&d=mm&r=g)
The source code in chuck-1.2.1.3 that processes the argument to Machine.add
is expecting to parse a filename and optional arguments using colons to
separate the filename and arguments, but it also looks like it's trying to
allow \: to escape a colon.
On Fri, Oct 15, 2010 at 10:05 AM, Rebecca Fiebrink
Have any ChucK windows users figured out how to accomplish Machine.add with a fully-qualified path name that includes the drive letter?
Machine.add("C:/Users/rebecca/tmp.ck") results in error "[C]: no such file or directory"
[tmp2.ck]:line(2): unrecognized escape sequence '\:'
That happens, most probably, because the Chuck parser is attempting to
That happens because the colon is treated the separator between the file name and an argument. and Machine.add("C\:/Users/rebecca/tmp.ck") results in error translate escape sequences into characters, long before even constructing the call to Machine.add(). Try Machine.add("C\\:/Users/rebecca/tmp.ck") that will let the escape sequence parse parse \\ into \, and then the argument parser will see \: and leave your filename alone. -- rec --
participants (4)
-
Laurie Hollander
-
Mat Schaffer
-
Rebecca Fiebrink
-
Roger Critchlow