Csound Csound-dev Csound-tekno Search About

[Csnd] Is it possible to write to a binary file in arbitrary position?

Date2019-07-10 18:38
FromMauro Giubileo
Subject[Csnd] Is it possible to write to a binary file in arbitrary position?

Hi, I would like to know if Csound has some opcode to write some values in a binary file at arbitrary position.

Something like that:

iFileHandle fiopen     "somefile.bin", 2 ; 2 -> open file in binary mode for writing
            write2file iFileHandle, iValueToWrite, iPositionInsideTheFile
            ficlose    iFileHandle

Being that I would like to store more than one value, it could be nice to pass an array to the hypothetical write2file function...

Regards,

---
Mauro


Date2019-07-12 12:45
FromRichard van Bemmelen
SubjectRe: [Csnd] Is it possible to write to a binary file in arbitrary position?
You could do it via Python inside Csound. You could even insert values into a database that way...

Richard 

Op wo 10 jul. 2019 om 19:38 schreef Mauro Giubileo <mgiubileo@computeraltafed.it>:

Hi, I would like to know if Csound has some opcode to write some values in a binary file at arbitrary position.

Something like that:

iFileHandle fiopen     "somefile.bin", 2 ; 2 -> open file in binary mode for writing
            write2file iFileHandle, iValueToWrite, iPositionInsideTheFile
            ficlose    iFileHandle

Being that I would like to store more than one value, it could be nice to pass an array to the hypothetical write2file function...

Regards,

---
Mauro

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-07-12 17:54
FromMauro Giubileo
SubjectRe: [Csnd] Is it possible to write to a binary file in arbitrary position?

Thanks, I will try.

But it would be very nice if I could write inside a binary file directly with a csound opcode. I think it doesn't exist yet, right?

Regards,

---
Mauro


Il 2019-07-12 13:45 Richard van Bemmelen ha scritto:

You could do it via Python inside Csound. You could even insert values into a database that way...
 
Richard 

Op wo 10 jul. 2019 om 19:38 schreef Mauro Giubileo <mgiubileo@computeraltafed.it>:

Hi, I would like to know if Csound has some opcode to write some values in a binary file at arbitrary position.

Something like that:

iFileHandle fiopen     "somefile.bin", 2 ; 2 -> open file in binary mode for writing
            write2file iFileHandle, iValueToWrite, iPositionInsideTheFile
            ficlose    iFileHandle

Being that I would like to store more than one value, it could be nice to pass an array to the hypothetical write2file function...

Regards,

---
Mauro

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here