sasikala's blog

Symbolic Links and Hard Links

Recently for a project, i need to create a symbolic link in window box.

I know the linux soft and hard link creation. But it is first time for windows. So want to share about creation of links in windows and linux.

How to create symbolic link in windows 

when i google it i got something called junction.exe. so how to use it?

  1. download it from http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx
  2. It is an exe file. Place it in folder c:\ or where you want it.
  3. Go to dos prompt type junction. It will show like below.
    C:\Program Files>junction

    Junction v1.05 - Windows junction creator and reparse point viewer
    Copyright (C) 2000-2007 Mark Russinovich
    Systems Internals - http://www.sysinternals.com

    The first usage is for displaying reparse point information, and the
    second usage is for creating or deleting a NTFS junction point:

    usage: junction [-s] [-q]
    -q Don't print error messages (quiet)

    -s Recurse subdirectories

    usage: junction [-d] []
    -d Delete the specified junction
    example: junction d:\link c:\winnt

  4. for example you want to create link called myprojectdir in c:\ pointing to actual folder c:\projects\projectname then  junction c:\myprojectdir "c:\projects\projectname"

    it will show like

    Junction v1.05 - Windows junction creator and reparse point viewer
    Copyright (C) 2000-2007 Mark Russinovich
    Systems Internals - http://www.sysinternals.com

    Created: c:\myprojectdir
    Targetted at: c:\projects\projectname

  5. To delete the link type : junction -d c:\myprojectdir 

Create Soft and Hard link in Linux

In linux, you can create soft link using ln -s command

for example, you want to create link called myproject in /tmp directory pointing to target directory /projects/project1


ln -s /projects/project1/myfiles.txt /tmp/myproject/myfiles.txt

to create hard link

ln /projects/project1/myfiles.txt /tmp/myproject/myfiles.txt

Hide and show the element

When you work in application, based on action you want to hide/show the particular or all elements in the page.

This can be achieved using the div tag and the style.

By setting the document.getElementById(id).style.display='none'; you can hide the element.

To show the element
document.getElementById(id).style.display='block';

for a sample

function showNextDiv()
{
document.getElementById("showFirst").style.display="none";
document.getElementById("ShowSecond").style.display="block";
}

Welcome to the Hide and show Element detail Page

I hope it is useful to you

you can toggle this based on click as like below

function toggleHideShow()
{
if(document.getElementById("ShowSecond").style.display=="none") {
document.getElementById("showFirst").style.display="none";
document.getElementById("ShowSecond").style.display="block";
}else {
document.getElementById("showFirst").style.display="block";
document.getElementById("ShowSecond").style.display="none";

}
}

Syndicate content