[LUAU] Windows shortcut equivalent in Linux

Vikram Khurana vkhurana at mail.nmfs.hawaii.edu
Fri May 21 19:44:12 PDT 2004


Thanks to everyone who suggested ideas. I haven't gotten it working yet, but
now I have pointers in the right direction...

Thanks,
Vikram

-----Original Message-----
From: luau-bounces at lists.hosef.org [mailto:luau-bounces at lists.hosef.org] On
Behalf Of Vince Hoang
Sent: Tuesday, May 18, 2004 5:34 PM
To: Linux/Unix Advocates/Users Hawaiian community discussion list
Subject: Re: [LUAU] Windows shortcut equivalent in Linux

On Tue, May 18, 2004 at 02:32:55PM -1000, Vikram Khurana wrote:
> The reason I can't do cd ~ is because it may or may not be in the home
> directory.
> Here is why. The way I intend to distribute this program is by zipping up
> the directory tree which looks like
> 
> /Parse/Linux/<Linux executable>
> /Parse/Windows/<Windows executable>
> /Parse/123.dat
> 
> Now the user could save this anywhere they want. Now in Win I can tell
> people to create a shortcut to /<some directory>/Parse/Windows/<Windows
> executable> & place it in any folder they want. The 123.dat file is read
> relative to the executables.
> 
> How do I do the same in Linux?

You mean "How do I do this in perl?"

Use readlink().

Create the symlink in your user's path. In your perl code, add
logic to read the symlink with readlink() and then strip off
everything accept the base path. As a bonus, grab your present
working directory with $ENV{PWD}. Now you have variables that
tell you about both directory trees that you need access to, and
can use chdir() at will.

-Vince
_______________________________________________
LUAU at lists.hosef.org mailing list
http://lists.hosef.org/cgi-bin/mailman/listinfo/luau




More information about the LUAU mailing list