473,657 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to create a soft link to a file


Hello,

I'm running on Mac OS X and need to create a soft link to a file.

I tried both makealias() and link(). While makealias creates a Finder
alias just fine my application that needs to read the reference file
doesn't like this. link() produces 1) a hard link and b) gives me the
following error: OSError: [Errno 45] Operation not supported

I guess what I'm looking for is a way to call the Unix ln command from
within my python program.

How would I do this?

Thanks,
Mark
Jul 18 '05 #1
2 7274
"Markus" <m.*****@gmx.de > wrote:
I'm running on Mac OS X and need to create a soft link to a file.

I tried both makealias() and link(). While makealias creates a Finder alias just fine my
application that needs to read the reference file doesn't like this. link() produces 1) a hard
link and b) gives me the following error: OSError: [Errno 45] Operation not supported

I guess what I'm looking for is a way to call the Unix ln command from within my python program.


A plain "ln" uses link(), of course. Assuming you meant "symbolic link"
and "ln -s", and that Mac OS X works like other Unixes, the function
you're looking for is called os.symlink:
help(os.symlink )


symlink(...)
symlink(src, dst)

Create a symbolic link.

Hope this helps!

</F>

Jul 18 '05 #2
Solved ;-)

I've found the symlink() function which works for me.

Thanks,
Mark
Markus wrote:

Hello,

I'm running on Mac OS X and need to create a soft link to a file.

I tried both makealias() and link(). While makealias creates a Finder
alias just fine my application that needs to read the reference file
doesn't like this. link() produces 1) a hard link and b) gives me the
following error: OSError: [Errno 45] Operation not supported

I guess what I'm looking for is a way to call the Unix ln command from
within my python program.

How would I do this?

Thanks,
Mark

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1708
by: Christian Seberino | last post by:
how do a post-install command like create a soft link? ..or where add command to setup.py?? I want to create a soft link automagically when user installs this program. Chris
3
1654
by: Tim Cowan | last post by:
Hi I have a script in ASP 3.0 which creates a CSV file on the server. After the code has run I want it to prompt the user to download the file (via the browser). I have spent a frustrating hour trying this. Can anyone help? Thanks Tim Cowan
7
18792
by: Martin | last post by:
I have a situation where I'm displaying some information in a table on a web page. I've given the user the ability to make several different "queries" and show different sub-sets of the data. I would like to add a button to the page that would allow the user to create an .XLS file that would contain the current contents of the table. I realize that I could create it on the server and allow him to download it but I'd rather let him create...
1
12246
by: Andrew Chanter | last post by:
I am writing a little routine to perform the following operations from an Acces 97 mdb: 1. create a fixed width text file 2. create/establish a table type link to the text file in Access 3. allow the user to view the text contained in the text file via an Access form. I have been able to achieve this, albeit with one major limitation. That is that the name of the text file needs to be known prior to runtime. In other
4
2010
by: Ping | last post by:
Hi, All, How to create a Shortcut File by programming in C++? To use whitch function or Windows API? Thinks.
3
1936
by: shapper | last post by:
Hello, I need to add a XML file from an Access database. Could someone tell me what would be the best approach? Thanks, Miguel
4
4053
by: vasu1308 | last post by:
Hi I want to about Soft link and Hard Link in Linux. Thanks Vasu
0
14280
ADezii
by: ADezii | last post by:
Rather than using CurrentProject.Connection or entering your own Connection information, ADO supports storing Connection information in an external file called a Data Link File (which normally has a *.UDL extension). Data Link Files provide two very important capabilities: They implement a graphical interface for constructing what can be complex and confusing OLE DB Connection Strings. They offer a way to allow Users to edit Connection...
1
1295
by: kevlee | last post by:
Hi. I'm pretty new to XSL and I need some help. I know I can create a text output from XSL below... ****************************************** <?xml version="1.0" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="text" /> <xsl:template match="/person"> BEGIN:VCARD
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.