473,385 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 7256
"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
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
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...
7
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...
1
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....
4
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
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
by: vasu1308 | last post by:
Hi I want to about Soft link and Hard Link in Linux. Thanks Vasu
0
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...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.