--- On Friday, April 26, 2013 9:53 PM, eryksun <eryk...@gmail.com> wrote:

On Fri, Apr 26, 2013 at 8:10 AM, mike <m...@froward.org> wrote:
>
> def link():
>     print "Adding %s to %s..." % (origFul, loadDir)
>     os.symlink('origFul', 'media')

Your arguments for symlink() are string literals. How about this?

    LOAD_DIR = "/opt/data/music/load"

    def link(media):
        src = os.path.abspath(media)
        dst = os.path.join(LOAD_DIR, os.path.basename(media))
        print "Adding %s to %s..." % (src, LOAD_DIR)
        os.symlink(src, dst)

IIRC, os.symlink is not present in Python on Windows, right? (I'm on vacation 
now so I can't check this). But aren't soft links and shortcuts linux and 
windows terms for the same thing? 
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to