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

Discussion in 'Java' started by soumya547@gmail.com, Apr 10, 2007.

  1. Guest

    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
     
    , Apr 10, 2007
    #1
    1. Advertising

  2. Guest

    On Apr 10, 10:15 am, wrote:
    > 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
     
    , Apr 10, 2007
    #2
    1. Advertising

  3. vishist Guest

    wrote:
    > 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
     
    vishist, Apr 10, 2007
    #3
  4. Guest

    On Apr 10, 10:33 am, vishist <> wrote:
    > wrote:
    > > 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


    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.
     
    , Apr 10, 2007
    #4
  5. Guest

    On Apr 10, 6:42 am, wrote:
    > On Apr 10, 10:33 am, vishist <> wrote:
    >
    >
    >
    >
    >
    > > wrote:
    > > > 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

    >
    > 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.
     
    , Apr 10, 2007
    #5
  6. wrote:
    > 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.
     
    Joshua Cranmer, Apr 10, 2007
    #6
  7. Philipp Guest

    Joshua Cranmer wrote:
    > wrote:
    >> 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.


    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
     
    Philipp, Apr 11, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Macchia
    Replies:
    3
    Views:
    1,082
    Roedy Green
    Apr 13, 2004
  2. TK

    Symbolic link

    TK, Oct 9, 2006, in forum: C++
    Replies:
    3
    Views:
    396
    Gavin Deane
    Oct 9, 2006
  3. mosscliffe

    Symbolic Link

    mosscliffe, Aug 18, 2007, in forum: Python
    Replies:
    12
    Views:
    720
    samwyse
    Oct 10, 2007
  4. Five By Five
    Replies:
    15
    Views:
    1,293
    William Gill
    Jan 14, 2009
  5. Peng Yu
    Replies:
    1
    Views:
    897
    Steven D'Aprano
    Oct 29, 2009
Loading...

Share This Page