Converting without write permissions

Bug #486378 reported by Andrew Bloxom on 2009-11-21
This bug report is a duplicate of:  Bug #525318: option to specify destination root. Edit Remove
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

I wanted to use dir2ogg to convert some files, however, they were located in a directory with which I did not have write permissions.

dir2ogg produced an error when trying to decode (unable to write), and decode (unable to find):
01 - Melatonin.flac: ERROR: can't open output file /media/4000/Music/Album/Silversun Pickups/(2006) Carnavas/01 - Melatonin.wav: Permission denied
Warning: Decoding of "/media/4000/Music/Album/Silversun Pickups/(2006) Carnavas/01 - Melatonin.flac" failed.

The solution to this issue was to modify the variables located around line 321 to allow for a path to be inserted thus any decoding, and encoding will be done in the specified directory.

        self.songwav = '/tmp/ogg/' + os.path.splitext(os.path.split(song)[1])[0] + ".wav"
        self.songogg = '/tmp/ogg/' + os.path.splitext(os.path.split(song)[1])[0] + ".ogg"

The path /tmp/ogg works for me as I have write permissions for that and any work with the files does not have to be done over the network as it would if I were writting into the directory where the song is located.

I believe this change will only effect the outcome when the arguments are files, I think a different section of the script is used for directories.

I have virtually no python script experiences so who knows.

I hope that future versions might allow me to define a temporary, or "working" directory to allow for this type of situation. In addition more and more people aren't storing their sound files locally, but instead on a network drive. Allowing for a temporary directory to be define will allow for flexibility for those who do not wish to back to the original directory, or in my case are unable to transfer them back due to permissions.

Thanks for putting together such a wonderful script, it's the only one I found that is able to carry over the Tags as a feature and has a command line interface. Truly a wonderful creation.

Andrew Bloxom (abloxom) on 2014-02-22
information type: Public → Private
information type: Private → Public
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers