Csound Csound-dev Csound-tekno Search About

[Cs-dev] Passing filename within quotes to csoundCompile

Date2008-06-09 18:55
From"Andres Cabrera"
Subject[Cs-dev] Passing filename within quotes to csoundCompile
AttachmentsNone  None  None  None  

Date2008-06-09 19:44
From"David Akbari"
SubjectRe: [Cs-dev] Passing filename within quotes to csoundCompile
AttachmentsNone  

Date2008-06-09 19:53
From"Andres Cabrera"
SubjectRe: [Cs-dev] Passing filename within quotes to csoundCompile
AttachmentsNone  None  None  None  

Date2008-06-09 20:10
From"David Akbari"
SubjectRe: [Cs-dev] Passing filename within quotes to csoundCompile
AttachmentsNone  

Date2008-06-09 20:11
FromFelipe Sateler
SubjectRe: [Cs-dev] Passing filename within quotes to csoundCompile
AttachmentsNone  None  None  

Date2008-06-09 20:13
From"Steven Yi"
SubjectRe: [Cs-dev] Passing filename within quotes to csoundCompile
AttachmentsNone  

Date2008-06-09 20:41
FromAnthony Kozar
SubjectRe: [Cs-dev] Passing filename within quotes to csoundCompile
Steven and Felipe are correct.  When you call csoundCompile(), the arguments
are already separated into separate strings, so you do not need to use
quotes or escape the spaces or any other character in any way.  This should
work on all platforms.

The only issue is if your program is reading commandline arguments from a
file or somewhere else, and then you need a way to distinguish between
spaces that indicate a new argument and those that are part of a filename.
For this, you can choose whatever convention makes sense to you.

Anthony

Steven Yi wrote on 6/9/08 3:13 PM:

> Hi Andres,
> 
> Are you passing in values from commandline with quotes or
> programmatically doing it in C++? If you're getting a commandline from
> a textfield or something like that, I think you'll have to do the
> parsing of the commandline yourself instead of behavior you'd see from
> running on commandline and having the shell parse the arguments and
> read the quoted text as a single value.
> 
> steven
> 
> On Mon, Jun 9, 2008 at 10:55 AM, Andres Cabrera  wrote:
>> Hi all,
>> I've found that passing a filename string which includes beginning and end
>> quotes for the arguments to csoundCompile (I'm using the C++ interface, so I
>> call csound.compile(argc, argv)) will make compilation fail with:
>> cannot open orch file
>> 
>> When I remove the quotes everyhting works as expected. Is this expected
>> behavior? If not what's a cross-platform way to handle filename with spaces
>> in this situation (I could substitute all spaces for "\ ", but I would think
>> this doesn't work for windows).
>> 
>> Cheers,
>> Andrés


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-06-09 20:43
From"Andres Cabrera"
SubjectRe: [Cs-dev] Passing filename within quotes to csoundCompile
AttachmentsNone  None  None  None