| As they say... works for me (in old parser). There is a problem with the
new parser I think, but with your code
SECTION 1:
new alloc for instr 1:
Audiofile does exist!
B 0.000 .. 1.000 T 1.000 TT 1.000 M: 0.00000 0.00000
and also works with does not exist
==John ff
> Having had no response to my inquiry concerning a possible bug in the
> filevalid opcode (see message below), I'm assuming that it will not work
> for
> my purposes.
>
> In addition, for several reasons, I'd like to use such an opcode in
> versions
> of Csound predating 5.13 (the first in which filevalid appears).
>
> So, does anyone know of a filevalid-style *UDO* (or could anyone construct
> one for me) that accomplishes the following more limited objectives:
> 1) searches only the current directory;
> 2) searches only soundin.x files (with x being the input parameter to the
> UDO)
> 3) (optionally) runs at k-rate (I *can* presumably put the UDO into a
> reinitialization routine if necessary; I'm already doing that with
> filelen)
>
> This needs to work cross-platform.
>
> FWIW, I'm not convinced that a UDO is possible here; the cross-platform
> requirement may well rule it (and the system opcode) out. If that's the
> case, it seems even more important that the apparent filevalid bug
> (limitation?) be corrected.
>
> Art Hunkins
>
> ----- Original Message -----
> From: "Art Hunkins"
> To:
> Sent: Monday, July 18, 2011 3:59 PM
> Subject: Re: [Csnd] Re: "file exists" opcode?
>
>
>> Menno,
>>
>> Thanks for your new example.
>>
>> I have tried filevalid in Csound 5.13.2 (Windows install, which is
>> doubles), and there seems to be a bug. The input variable, ifilcod, is
>> supposed to take a filename string *or* a number corresponding to the
>> end
>> of a soundin.x file (e.g., 1 for soundin.1). It doesn't do the latter.
>>
>> Modifying your file (below), there is no error message as written, but
>> when the commented line is substituted, csound complains that the input
>> is
>> not an S variable.
>>
>> FWIW, filelen (which also uses ifilcod) works fine (as it should) with a
>> single digit following filelen.
>>
>> Could you and others please take a look at this?
>>
>> Art Hunkins
>>
>>
>>
>>
>>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr 1
>>
>> ivld filevalid "soundin.1"
>> ;ivld filevalid 1
>>
>> if ivld>0 then
>> puts "Audiofile does exist!", 1
>> else
>> puts "Audiofile does not exist!", 1
>> endif
>> endin
>>
>>
>>
>>
>> i 1 0 1
>>
>> e
>>
>>
>>
>> ----- Original Message -----
>> From: "menno"
>> To:
>> Sent: Monday, July 18, 2011 12:23 PM
>> Subject: [Csnd] Re: "file exists" opcode?
>>
>>
>>> this is already fixed in git.
>>> And a new example of filevalid can be found here:
>>> http://members.home.nl/mag.knevel/csound_betamanual/filevalid.html
>>>
>>> greetings
>>> Menno
>>>
>>> --
>>> View this message in context:
>>> http://csound.1045644.n5.nabble.com/file-exists-opcode-tp4599987p4600195.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>>
>>> 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"
>
>
>
>
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"
|