Csound Csound-dev Csound-tekno Search About

[Csnd] how to create a new directory?

Date2010-07-30 07:29
Fromjoachim heintz
Subject[Csnd] how to create a new directory?
hi all -

when i want to write a soundfile with the fout opcode in a folder  
which does not already exist, i get an error message:
"error opening sound file '/Users/jh/Desktop/newdir/ 
sound.wav'" (because "newdir" does not exist).

at the moment, i help myself with the system opcode:
ir system_i 1, "mkdir Users/jh/Desktop/newdir", 1

this works, but for the platform compatibility of examples it would be  
better to do it with an opcode.

is there any?

if not, can fout be extended to create a new directory if does not  
exist instead of returning an error?

thanks -

	joachim


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-07-30 08:47
FromAndres Cabrera
Subject[Csnd] Re: how to create a new directory?
Hi,

You could use python:

import os
os.mkdir('/new/dir/name)

but that's not a very elegant solution...

Cheers,
Andrés

On Fri, Jul 30, 2010 at 7:29 AM, joachim heintz  wrote:
> hi all -
>
> when i want to write a soundfile with the fout opcode in a folder which does
> not already exist, i get an error message:
> "error opening sound file '/Users/jh/Desktop/newdir/sound.wav'" (because
> "newdir" does not exist).
>
> at the moment, i help myself with the system opcode:
> ir system_i 1, "mkdir Users/jh/Desktop/newdir", 1
>
> this works, but for the platform compatibility of examples it would be
> better to do it with an opcode.
>
> is there any?
>
> if not, can fout be extended to create a new directory if does not exist
> instead of returning an error?
>
> thanks -
>
>        joachim
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>



-- 


Andrés


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-07-30 09:06
Fromjoachim heintz
Subject[Csnd] Re: Re: how to create a new directory?
thanks. maybe not very elegant, but the python solution is better in  
respect to platform compatibility, i think.
best -

	joachim


Am 30.07.2010 um 09:47 schrieb Andres Cabrera:

> Hi,
>
> You could use python:
>
> import os
> os.mkdir('/new/dir/name)
>
> but that's not a very elegant solution...
>
> Cheers,
> Andrés
>
> On Fri, Jul 30, 2010 at 7:29 AM, joachim heintz  
>  wrote:
>> hi all -
>>
>> when i want to write a soundfile with the fout opcode in a folder  
>> which does
>> not already exist, i get an error message:
>> "error opening sound file '/Users/jh/Desktop/newdir/ 
>> sound.wav'" (because
>> "newdir" does not exist).
>>
>> at the moment, i help myself with the system opcode:
>> ir system_i 1, "mkdir Users/jh/Desktop/newdir", 1
>>
>> this works, but for the platform compatibility of examples it would  
>> be
>> better to do it with an opcode.
>>
>> is there any?
>>
>> if not, can fout be extended to create a new directory if does not  
>> exist
>> instead of returning an error?
>>
>> thanks -
>>
>>        joachim
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe
>> csound"
>>
>>
>
>
>
> -- 
>
>
> Andrés
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"
>
>



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"