From help-octave-request at bevo dot che dot wisc dot edu Wed Jan 31 06:46:42 2001 Subject: Lifetime of variables and .oct files From: Pascal Fleury

To: help-octave at bevo dot che dot wisc dot edu Date: Wed, 31 Jan 2001 21:43:31 +0900 This is a multi-part message in MIME format. --------------F74F61840983CC7E8EABA229 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi there ! I have an .oct file in which I open a file, and get the file descriptor for it. This has to be given to subsequent accesses to the function in the .oct file. So I can open a file, and make multiple accesses from octave scripts to get chunks of the data in the file. Example: infile = opensndfile("mysound.aiff") # opens a file, creates some structure in memory within the .oct file chunk1 = readsndblock(infile, 1024) # reads 1024 samples chunk2 = readsndblock(infile, 1024) # read the following 1024 samples infile = 2 # Here: the file should be closed, and the memory released in the .oct file But I do not know when I can close the file and remove the info in memory, as this should be done ideally when the variable goes out-of-scope or stops living within Octave (e.g. infile gets assigned a new value). Is there a way of knowing this in the .oct file ? Am I guaranteed that the .oct file will not be unloaded before this happens ? Or is my complete design wrong ? Thanks for any help, Pascal --------------F74F61840983CC7E8EABA229 Content-Type: text/x-vcard; charset=us-ascii; name="p.fleury.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Pascal Fleury Content-Disposition: attachment; filename="p.fleury.vcf" begin:vcard n:Fleury;Pascal x-mozilla-html:TRUE adr:;;;;;; version:2.1 email;internet:fleury at sslab dot sony dot co dot jp fn:Pascal Fleury end:vcard --------------F74F61840983CC7E8EABA229-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------