tags:

views:

76

answers:

2

os.link is not working for the attached Volumes on Mac.

~ $ python
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.link("/Volumes/ARCHANA/JULY 09/PRAMANPATRA.doc", "/Volumes/ARCHANA/temp")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 45] Operation not supported
>>>
+1  A: 

What filesystem in on ARCHANA? And are you trying to link to a directory? Not all file systems support hardlinks, and very few support hardlinks to directories.

In particular USB mass-storage devices are generally formatted as with FAT filesystems which do not support links.

dmckee
Yep, my pendrive is formatted as FAT32
Vijayendra Bapte
+2  A: 

You're working on a mac, yet the volume ARCHANA might not have a link-able file system. (The uppercase label makes it suspicious.)

Also, you are trying to refer a hard link to a directory and "Hard links may not normally refer to directories and may not span file systems." (from the man page.)

One last thing to try seems the directory name 'July 09'. It might be worth inspecting the os.link function to check that it works with spaces in directory names.

deau
Destination is a file. I am not linking to a directory. My pendrive has FAT32 file system. I have tested with normal folder without spaces, but still it throws same error. Thanks!
Vijayendra Bapte