how to create a symbolic link in linux at runtime using java

S

soumya547

hai friend...
i want help for the topic,how to create a Symbolic Link in linux at
runtime using java.
the code should be complete java.so that it will work in any plat
form...
kindly send me the solution soon.....

with regrds...
soumya
 
S

soumya547

hai friend...
i want help for the topic,how to create a Symbolic Link in linux at
runtime using java.
the code should be complete java.so that it will work in any plat
form...
kindly send me the solution soon.....

with regrds...
soumya

i have tried using Runtime time Class but,i think that is not the
right way to do the think...
because,it may not work in other plaftform like solaris and all...so i
need a code which should be in pure java.
with regrds..
soumya
 
V

vishist

hai friend...
i want help for the topic,how to create a Symbolic Link in linux at
runtime using java.
the code should be complete java.so that it will work in any plat
form...
kindly send me the solution soon.....

with regrds...
soumya

friend?
Anyway, can you explain me what is a symbolic link and how do you create
it in a console?. How do you invoke Runtime commands from a Java
application?. What does ".so" extension stand for and does it work on
all platforms?

Please GIYF and let us know what you found out.

thanks
 
S

soumya547

friend?
Anyway, can you explain me what is a symbolic link and how do you create
it in a console?. How do you invoke Runtime commands from a Java
application?. What does ".so" extension stand for and does it work on
all platforms?

Please GIYF and let us know what you found out.

thanks

symbolic link in linux means like short cuts in windows,u can create
symbolic link by using command like this "ln -s dir_name ./
symbolic_link_name".
you can invoke runtime command using Runtime and Process class which
is there in Java.io package.
i will give u the code just go through it....



Runtime rt=Runtime.getRuntime();
Process result=null;
String exe=new String("ln"+" -s "+source+" ./"+target);
result=rt.exec(exe);

but this code is not pure java code.because it will not work in all
plat form.so i want any other way other than this.
 
U

usenetuser

symbolic link in linux means like short cuts in windows,u can create
symbolic link by using command like this "ln -s dir_name ./
symbolic_link_name".
you can invoke runtime command using Runtime and Process class which
is there in Java.io package.
i will give u the code just go through it....

Runtime rt=Runtime.getRuntime();
Process result=null;
String exe=new String("ln"+" -s "+source+" ./"+target);
result=rt.exec(exe);

but this code is not pure java code.because it will not work in all
plat form.so i want any other way other than this.- Hide quoted text -

- Show quoted text -

But symbolic links aren't supported by all platforms/file-systems.
 
J

Joshua Cranmer

hai friend...
i want help for the topic,how to create a Symbolic Link in linux at
runtime using java.
the code should be complete java.so that it will work in any plat
form...
kindly send me the solution soon.....

with regrds...
soumya


1. Please use proper capitalization, grammar, punctuation, and spelling.
2. A ".so" file is anything but platform compatible, as it is
(presumably) an ELF library using processor instructions for x86 or MIPS
or SPARC or PowerPC or something similar.
3. symbolic links are not supported across filesystems, let alone across
operating systems (think FAT).
4. You specifically mention that code for Linux should be
cross-platform. Think carefully about what that entails.

In short, the answer is: this is impossible to perform to the specifics
that you have requested. If you want code to make a symbolic link for
*nix, that is a different case.
 
P

Philipp

Joshua said:
1. Please use proper capitalization, grammar, punctuation, and spelling.

And spacing?

(...)the code should be complete java. So that it will work in any (...)

Maybe "java.so" isn't what we understood at first :)

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top