Question

symlinks

Asked by: jaredc

I have an application which is actually a windows application but the files for the application are sitting on a solaris server.

The application has a config directory which it expects to find off the application directory. I would like to have this config directory actually in the home directory of each user so that each is able to have their own config directory.

I am thinking something along the lines of a symlink that points to ~/config although exactly how to do this escapes me at the moment... ie.

ln -s \~/config config
doesn't work because then the '~/' is interpreted as part of the file name.

ln -s ~/config config
doesn't work because it replaces the ~ with my home dir path...

Can anyone tell me how I'd do this ?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2000-03-06 at 21:22:45ID10306494
Tags

solaris

,

symlinks

Topic

Sun Solaris

Participating Experts
6
Points
50
Comments
23

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Symlink
    How do I create a symlink from a prompt. I can do it fine from MC but need to learn it from a prompt. Thanks Bob Ross
  2. how do i do a symlink?
    hi there, well i heard that to make my plugin work ill have to make a symlink in /usr/lib/mozilla/plugins to /libjavaplugin_oji.so but i dont know how to do the symlink,, how do i do it?? thanks!
  3. SymLink
    hello experts .. i have a question i want to create a function which returns boolean when trying to make a symlink in my HDD..... for example function(link:string,realpath:string):boolean ... when calling this function it ll try to create a link between 2 paths ... and if i ...
  4. vsfpd virtual user and symlinks (ln -s)
    Linux RedHat 7.3 vsftpd 1.2.1 & db3 I have setup the vsftpd for virtual user access (using the example VIRTUAL_USERS_2) The user can connect correctly to 'their' home and upload,download etc. In the users home I have set a symlink to an Apache httpd/awebsite/subdir e.g ...
  5. symlinks
    hello, my web hosting doesnt allow access through SSH and I need to make some symlinks, im using windows xp and when I decompress the zip file with symlinks it wont allow it, can someone please help me out here?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: freesourcePosted on 2000-03-06 at 21:38:44ID: 2590320

Let's say the configuration file is in /etc/config.

ln -s /etc/config ~/config

Just make sure you get the permissions right so that everyone can use the file, and realize if normal users can access the central configuration file in this manner, they also can change the central configuration file if they have write permissions.

 

by: GP1628Posted on 2000-03-07 at 12:33:18ID: 2593165

Im not sure that you can do what you want to do.

If you link to the config directory then everyone has only one config file. The main one.

For the program to accept multiple config files that will have to be an option of the program.  Something along the line of a command-line option when the program is called such as

theprogram.exe -c ~/config

then just give each user their own script to call the program.

OR if the program can accept alternate directorys for config but doesnt recognize ~ give each user a script for

theprogram.exe -c ./config

where the period will specify the directory that the script is run from.

 

by: jaredcPosted on 2000-03-07 at 16:10:22ID: 2593851

Ok, GP1628

Unfortunately the program doesn't have a command line option for the config directory - that would be nice and easy.

And I think freesource missed the idea a little. So I will try to clarify a little more.

The program requires a directory structure as follows.

program_dir/
     config

I would like to set it up such that config is a symlink to a config directory inside each and every users home.

ie

program_dir/
     config -> ~/config

so that if I run the program it picks up the config files from my home directory, and if the person sitting on my right runs the program it picks up the config files from his home directory. In this way there is no central config file - this is so that each user is able to have their own macros and setup and so forth without interfering what other people want to have set up.



 

by: GP1628Posted on 2000-03-07 at 17:01:17ID: 2593979

Thats just it. links wont do that.

Unless the program itself is willing, I cant think of a way to do it.

Is the config path absolute? or is it relative? Does it look for the configs in a particular directory or one particular to the location that the program starts up in?

If there is no command line option.... is ther ean ini file which might inclucde the path structure that it is to use for its files? If installation wrote a line that the config resides in /myprog/config then removing the /myprog/ will often cause it to look in the directory its called in for the files.

Gandalf Parker

 

by: GP1628Posted on 2000-03-07 at 17:09:10ID: 2593998

Hmmmm I thought about it some more. The problem with links is that its a command that allows many people to have access to one file, you kindof want it to work in reverse with one file being access to many peoples files.
This is purely a shot in the dark but I believe since its unix it should work.

If each person had a script which
 ln -s config /theprogram/conf
 theprogram

then it would create a new link each time they run it. Im not sure if it would overwrite the old link of the other user but if it did then this should work.
Since the program has already read the config and is already up and running it shouldnt be affected by the fact that the link changed.

You would have to test it to be sure.

Gandalf Parker

 

by: freesourcePosted on 2000-03-07 at 17:09:12ID: 2594000

Exactly which program is this anyways?

 

by: jaredcPosted on 2000-03-07 at 19:12:03ID: 2594290

I may have to try that Gandalf - although I don't expect it will work so nicely because the config files get written to by the program as well, I presume that it would require the link to be intact when it comes to do the write, otherwise I may be trying to overwrite someone elses config files.

With regards to what the program is it's a windows text editor by the name of MultiEdit.

 

by: jaredcPosted on 2000-03-07 at 19:15:12ID: 2594297

Is there then an alternative to a link which may work in this way that I am unaware of ? (My unix knowledge isn't particularly large).

 

by: freesourcePosted on 2000-03-07 at 22:03:30ID: 2594698

Yes, the way to do this would be to write a wrapper script.

Instead of running MultiEdit you would run the wrapper instead which would take care of finding the configuration file for whatever user runs the program.  There lot's of ways it could be written to do this.

Once way would be to simply copy over the configuration file to the only directory MultiEdit looks in, then execute MultiEdit, when MultiEdit finishes it will just remove the program.

Like this:

#!/usr/bin/perl

# By freesource
# Give it a name .. chmod 755 name.
# Put it in a Path
# Edit this to specifications, make sure
# the first bang line points to perl on
# your system . make sure you have perl
# or write something similiar in shell
# script.

$user_conf = $ENV{"HOME"} . "/config";

# copy user configuration file over
system "copy $user_conf /MultiEdit";

# run program
system "MultiEdit";

#clean out program directory
system "rm /MultiEdit/config";

   


 

by: freesourcePosted on 2000-03-07 at 22:18:17ID: 2594722

Oh, and this line:

# copy user configuration file over
system "copy $user_conf /MultiEdit";

Should be this way instead

system "cp $user_conf /MultiEdit";

:)

.... so

#!/usr/bin/perl

# By freesource 1-8-2000
# Give it a name .. chmod 755 name.
# Put it in a Path
# Edit this to specifications, make sure
# the first bang line points to perl on
# your system . make sure you have perl
# or write something similiar in shell
# script.

$user_conf = $ENV{"HOME"} . "/config";

# copy user configuration file over
system "cp $user_conf /MultiEdit";

# run program
system "MultiEdit";

#clean out program directory
system "rm /MultiEdit/config";

 

by: jaredcPosted on 2000-03-08 at 14:38:51ID: 2598196

Hmmm, there is a small problem with this.

Firstly the program is a Windows program so it actually gets run on the Windows boxes and the files are kept on the UNIX box.

The second problem is that the link to the config files is live and the files may change during a session - if a second user were to open up a session it may mess up the first user - or not let the second user overwrite the config files which may still be held open by the program.

 

by: freesourcePosted on 2000-03-08 at 17:44:53ID: 2598685

You could use wine to run the program on the unix boxes, and a lock could be used.  It sounds like there will be many users using the program concurrently, but there are tricks to accomplish this.  Where can I find this program to try some experiments?

 

by: ahoffmannPosted on 2000-03-09 at 01:14:37ID: 2599720

as GP1628 said, the only way might be a wrapper script which generates the symlink on the fly, but then you run into problems when more than on user accesses the program.

> Hmmm, there is a small problem with this.
> Firstly the program is a Windows program ..
NO, this is the only problem ;-)
Windows programs are designed for single-user, single-tasking, usually, so there is no need for multi-user support, IT'S WINDOZE. Dot.

If this stupid Windoze program cannot deal with multiple users, you may try to make a new installation for each user, therefore using it's own config directory for each user.

 

by: jaredcPosted on 2000-03-09 at 17:17:32ID: 2602895

freesource - MultiEdit is made by a company call american cybernetics - I can't see a web address on it.

ahoffmann - yes I tend to agree with you that windows is the problem - but that is the environment I am working under (and personally I don't actually know enough about unix nor have the time to move myself to it now.

If no-one comes up with an answer that is easier for me I think I'll have to  give this one to Gandalf

 

by: paulqnaPosted on 2000-03-10 at 14:08:13ID: 2606302

when you say:

ln -s ~/config config
doesn't work because it replaces the ~ with my home dir path...

its worth trying to do
# su <username>
then
# ln -s ~/config config # orwathever you want
and then to get back to your user
# exit

Hopeing I understood your question...

 

by: jaredcPosted on 2000-03-14 at 16:37:36ID: 2618071

paulqna,

when you do a ln -s ~/config config the command interpreter will interpret the ~ immediately as being the home directory of the current user, hence if I do that the link is to /usr/jaredc/config, when the next person comes along the link will still point into my home dir rather than theirs.

It is possible to escape the ~ character but then it is not interpreted when you use the link either.

 

by: markus_baertschiPosted on 2000-03-16 at 03:46:16ID: 2623145

What about putting the other way round. Instead of creating link
for the config file you create a links for all the files of the program.

You have a directory /home/program holding all the program files.
You have a directory /home/user1/program wit the config file
and links for all other files pointing to /home/program.
Depending on how your PC is getting at the files (NFS, samba)
you can not use symlinks, but neet to use 'normal' links. As
long as your fileas are in the same filesystem on the unix box
it will work the same.

Markus

 

by: paulqnaPosted on 2000-03-16 at 12:18:47ID: 2625192

Then

# ln -s ~/config config # orwathever you want.

Should be

# ln -s \~/config config # orwathever you want.

Paul

 

by: paulqnaPosted on 2000-03-16 at 12:19:45ID: 2625194

Sorry when i was reading your question i saw this was a really stupid one... ;(

 

by: jaredcPosted on 2000-03-16 at 20:36:27ID: 2626563

Markus - This one is a good idea, and I am trying that as well, although unfortunately I think it may create other problems as well.

But certainly this is the closest anyone's come to an idea that may solve the problem so far.

 

by: markus_baertschiPosted on 2000-03-17 at 00:59:01ID: 2627086

Just some more remarks.
Most PC apps unfortunately beleave to be only thing the (one) user of the (single) machine ever wants to run...

However, for my thing to work there are two ways:
1) You export /home on your server and will see the files as X:\user1\program on the PC.
In this case symlinks will work, but users can see all other users
directories on drive X:. This might be a problem.
2) You export /home/user1 on your server and will see the files as X:\program on the PC.
Here you need 'normal' links. For this to work the programs files
and the users files need to be in the same filesystem.

How big is this app anyway ? Is is huge enough to bother ? It might
be easier and cheaper (work !) just to spend some MB/GB and install
is in each users directory.

Not nice, but simple and reliable !

 

by: ahoffmannPosted on 2000-03-17 at 02:18:12ID: 2627318

still suggested to install it per user.
I'm also not shure if it is possible to use symlinks for the program files (instead of a new installation), 'cause of M$'s proprietary file-locking when using a program or a data file used by this program.
This needs to be tested extensively.

 

by: festivePosted on 2000-03-21 at 23:08:22ID: 2643421

something that may help:

after you have created the directoy and set group permissions on it carefully, you could put a symbolic link in /etc/skel which should then allow automatic replication of the directory tree (and symbolic link) for each new user.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...