Bugzilla – Bug 60
Nyquist plug-ins can't write text file to a standard user-accessible location
Last modified: 2018-08-20 11:45:21 UTC
* SD: See URL. Nyquist working directory, as reported by (setdir "."), is the audacity program folder in some builds and the modules folder in other build. o On Linux, both of these directories are write protected for user accounts. o On Windows, the Nyquist working directory may be changed for some Audacity builds by setting the "Start In" option of the Audacity launch icon. On other builds (including RC1) it cannot be set this way. * GA: Roger D has committed a GET-ENV function in xlsys.c to get environment strings. It seems this would allow you to look up "HOME" on any system. So this P4 can be solved when we update to the latest Nyquist version.
Steve wrote: > Is this now fixed on all platforms? Hard to tell - have you tested / can you add steps to repro so others can test on their platform? The Nabble URL no longer works. The chronology seems a bit unclear. * Last update of Audacity-Nyquist seems to be to v3.03 (March 5 2009) * get-env was added by Roger to /lib-src/libnyquist/nyquist/xlisp/xlsys.c on 26 Sep 2010 but a note in that file (that comment 0 refers to) says "11-Dec-09 Roger Dannenberg Added getenv". So if fixing this requires not only the change in /lib-src/libnyquist/nyquist/xlisp/xlsys.c but updating Audacity-Nyquist for the 11 Dec 09 change, then no it isn't fixed. Added Roger to Cc list for this bug.
(In reply to comment #1) I think this is the new address of the nabble URL: http://audacity.238276.n2.nabble.com/Setting-Nyquist-working-directory-td4134136i20.html GET-ENV has been available in Audacity since 1.3.13 beta. To test, the following code entered in the Nyquist Prompt should return your home directory: (print (or (get-env "HOME") (get-env "UserProfile"))) I think the "bug" as described in the title is a can't fix or won't fix (or "isn't broken") but as "HOME" can now be looked up in Nyquist, can this now be marked as resolved?
(In reply to comment #2) I think this is a good argument for using Bugzilla as the bugs database, not mailing lists (just reference the Bugzilla URL if you need to split off long discussions to a list or Wiki). > I think this is the new address of the nabble URL: > http://audacity.238276.n2.nabble.com/Setting-Nyquist-working-directory-td4134136i20.html Thanks, I updated the URL in this bug. > GET-ENV has been available in Audacity since 1.3.13 beta. > > To test, the following code entered in the Nyquist Prompt should return your > home directory: > > > (print (or (get-env "HOME") (get-env "UserProfile"))) Tested now OK in HEAD on Windows 7 x64 in both 1.3.13 ANSI and 1.3.13 Unicode. I think this has been tested already on XP too, in Forum discussions? Have you tested in Nyquist Workbench? I'd have to rebuild Audacity to test that. > I think the "bug" as described in the title is a can't fix or won't fix (or > "isn't broken") Changed title to "Nyquist plug-ins can't write text file to a standard user-accessible location". > but as "HOME" can now be looked up in Nyquist, can this now be marked as > resolved? Changed Status to "DEVEL - FIX MADE". Please advise if we need to test Nyquist Workbench. The Nyquist Prompt HOME lookup should be tested on Mac, if it hasn't already been. Thanks.
(In reply to comment #2) On a Mac Book here, at the Nyquist prompt (print (or (get-env "HOME") (get-env "UserProfile"))) responded "/Users/martyn" and Portable Ubuntu responded C:\Users\Martyn is that useful? TTFN Martyn
> I think this has been tested already on XP too, in Forum discussions? I think it's been tested on all platforms http://forum.audacityteam.org/viewtopic.php?f=39&t=42368 > Have you tested in Nyquist Workbench? Yes (Linux only). It works fine. > Changed title to "Nyquist plug-ins can't write text file to a standard > user-accessible location". I'm not sure that really describes the problem. The issue is that neither the default "current working directory" or the default "sound file directory" can be relied on to be writeable. On Mac, Linux (and probably Windows) the location depends on where Audacity was launched from. The defaults for a 'standard' install an launch of Audacity 1.3.13 on Mac is: (setdir ".") /Applications/Audacity 1.3.13 *default-sf-dir* /Applications/Audacity 1.3.13 and for Linux: (setdir ".") /home/<user> *default-sf-dir* /home/<user> but if Audacity is launched from the command line then it will probably be different. As long as the home folder can be found (which it can now), Nyquist can be set to use the home folder (or any user defined folder) for the "current working directory" and the "sound file directory". The (minor) issue is that Audacity does not (always) do this automatically. > The Nyquist Prompt HOME lookup should be tested on Mac, It has been. http://forum.audacityteam.org/viewtopic.php?f=39&t=42368
>> Changed title to "Nyquist plug-ins can't write text file to a standard >> user-accessible location". > I'm not sure that really describes the problem. I was using your own text from the URL you give i.e. "The practical task in question is how to reliably write a text file to a location that is accessible to the average Audacity user", The current subject is what I understood has been fixed and what we would be closing this bug on. I see we also opened and closed Bug 247 "Can't set user's HOME dir for text file output in Nyquist plug-ins" at the time of the Nabble discussion without apparently remembering this bug. > The issue is that neither the default "current working directory" or the > default "sound file directory" can be relied on to be writeable. On Mac, > Linux (and probably Windows) the location depends on where Audacity was > launched from. As long as the home folder can be found (which it can now), > Nyquist can be set to use the home folder (or any user defined folder) for > the "current working directory" and the "sound file directory". > > The (minor) issue is that Audacity does not (always) do this automatically. Could you explain this "minor issue" in more detail so we can decide a rating? You want Audacity to 100% reliably set CWD and SFD to the user's home folder? Does the failure to do this mean that a plug-in that has a text box for directory entry should (according to the plug-in's help) default to home (goes there if empty), but sometimes the default goes elsewhere? If so, do we know why it goes elsewhere e.g. command-line launch? Since we already opened and closed one analogous bug probably we could close and re-open this one when your issue is clear.
(In reply to comment #6) > I was using your own text from the URL you give i.e. "The practical task in > question is how to reliably write a text file to a location that is accessible > to the average Audacity user", The current subject is what I understood has > been fixed and what we would be closing this bug on. Thanks, yes I see what you mean. That does describe the original bug (which is now fixed). > I see we also opened and closed Bug 247 "Can't set user's HOME dir for text > file output in Nyquist plug-ins" at the time of the Nabble discussion without > apparently remembering this bug. IIRC that bug was posted about the specific issue of the incorrect (GETENV) command. The "bug" was that a code comment incorrectly said "GETENV" when it should have said GET-ENV. > Could you explain this "minor issue" in more detail so we can decide a rating? > You want Audacity to 100% reliably set CWD and SFD to the user's home folder? > > Does the failure to do this mean that a plug-in that has a text box for > directory entry should (according to the plug-in's help) default to home (goes > there if empty), but sometimes the default goes elsewhere? If so, do we know > why it goes elsewhere e.g. command-line launch? Prior to December 2009 there was no way to set a write path in a Nyquist plug-in that would be guaranteed to be writeable. (The workaround was for the user to manually enter a fully qualified path). (setdir ".") and *default-sf-dir* depend on the OS and where Audacity was launched from. These locations are not fixed and may or may not be writeable. Any plug-in that attempts to write to the "current directory" or to the "default sound file" directory may fail as these locations may or may not be writeable. The (GET_ENV) function was created to solve this issue, so really this is fixed. However, Nyquist Plug-in authors need to be aware that if they want a plug-in to write to disk, they should not use the "current directory" or to the "default sound file" directory unless they have explicitly set them to writeable locations. The "remaining issue" is that I don't think that this is in the Audacity documentation.
(In reply to comment #7) > The "remaining issue" is that I don't think that this is in the Audacity > documentation. As I understand it, Bugzilla does not cover docs issues except for documentation stored in SVN, so bug 60 is now RESOLVED - FIXED. I already added a note in "Nyquist Conventions" about using the home dir for text output: http://forum.audacityteam.org/viewtopic.php?f=39&t=42106#p109405 Unless you have a better idea I think the appropriate thing still left to do is add a section about this to: http://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference Can you do that please? More generally I think there is confusion about how to put forward Nyquist bugs and enhancements. The problem with Audacity-Nyquist not being able to read environment variables containing non-ASCII characters has been mentioned on the Forum but I believe it's only an explicit case of Audacity-Nyquist not being Unicode aware. Referring URLs are: http://forum.audacityteam.org/viewtopic.php?f=39&t=42932&start=0 http://audacity.238276.n2.nabble.com/Unicode-Problems-td5681026.html This does not seem to be on Bugzilla but I think it should be (P4). Can you add that bug as I assume you understand it more than I do? Then there are Nyquist "wish list" items: http://forum.audacityteam.org/viewtopic.php?f=39&t=38252 This isn't urgent but I think sometime there should be a Wiki Proposal for Nyquist enhancements, possibly in the first instance just a page to thrash out what would be the most valuable enhancements then perhaps put those ones on Bugzilla.