Make a symlink on the system.
333147
def _make_symlink(self, link_name: str, link_target: str):
        ''''''
        path = self._file_writer_session.extra_resource_path('dummy')

        if path:
            dir_path = os.path.dirname(path)
            symlink_path = os.path.join(dir_path, link_name)

            _logger.debug('symlink {} -> {}', symlink_path, link_target)

            os.symlink(link_target, symlink_path)

            _logger.info(
                _('Created symbolic link {symlink_path} to target {symlink_target}.'),
                symlink_path=symlink_path,
                symlink_target=link_target
            )
981375
function AttemptRootSymlink() {

    if (process.platform === 'win32') {
      var curPath = resolve("./");
      if (debugging) {
          console.log("RootSymlink Base path is", curPath);
      }
      cp.execSync("powershell -Command \"Start-Process 'node' -ArgumentList '"+curPath+"/install.js symlink' -verb runas\"");
    } else {
      console.log("To automatically create a SymLink between your web app and NativeScript, we need root for a second.");
      cp.execSync("sudo "+process.argv[0] + " " + process.argv[1] +" symlink");
    }
}
927752
def symlink(target, link):
    
    if islink(link):
        unlink(link)
    if platform.system() == "Windows":
        if sys.version_info[:2] < (3, 5):
            with open(os.devnull, "w") as nul:
                subprocess.check_call(["mklink", "/J", link, target], shell=True, stdout=nul)
        else:
            _winapi.CreateJunction(target, link)
    else:
        os.symlink(target, link)
594203
def inlink_file(self, filepath):
        
        if not os.path.exists(filepath):
            logger.debug("Creating symbolic link to not existent file %s" % filepath)

        # Extract the Abinit extension and add the prefix for input files.
        root, abiext = abi_splitext(filepath)

        infile = "in_" + abiext
        infile = self.indir.path_in(infile)

        # Link path to dest if dest link does not exist.
        # else check that it points to the expected file.
        self.history.info("Linking path %s --> %s" % (filepath, infile))

        if not os.path.exists(infile):
            os.symlink(filepath, infile)
        else:
            if os.path.realpath(infile) != filepath:
                raise self.Error("infile %s does not point to filepath %s" % (infile, filepath))
367544
def create_nv_link(self):
        """"""
        from os.path import abspath, islink
        from os import unlink, symlink

        nv_name = self.doc.as_version(None)

        from_path =  abspath(self._last_write_path or self.package_path.path)

        to_path = join(dirname(from_path), nv_name + self.type_suffix)

        if islink(to_path):
            unlink(to_path)

        symlink(from_path, to_path)
192106
public static int symLink(String target, String linkname) throws IOException{
    String cmd = "ln -s " + target + " " + linkname;
    Process p = Runtime.getRuntime().exec(cmd, null);
    int returnVal = -1;
    try{
      returnVal = p.waitFor();
    } catch(InterruptedException e){
      //do nothing as of yet
    }
    return returnVal;
  }
50239
def _create(self):
        """"""
        if self.readonly:
            raise VirtualenvReadonlyException()
        args = ['virtualenv']
        if self.system_site_packages:
            args.append('--system-site-packages')
        if self.python is None:
            args.append(self.name)
        else:
            args.extend(['-p', self.python, self.name])
        proc = subprocess.Popen(args, cwd=self.root, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        output, error = proc.communicate()
        returncode = proc.returncode
        if returncode:
            raise VirtualenvCreationException((returncode, output, self.name))
        self._write_to_log(output, truncate=True)
        self._write_to_error(error, truncate=True)
1126827
def put(self, key, value):
    ''''''
    # if value is a link, don't follow links
    if self._link_for_value(value):
      super(SymlinkDatastore, self).put(key, value)
      return

    # if `key` points to a symlink, need to follow it.
    current_value = super(SymlinkDatastore, self).get(key)
    link_key = self._link_for_value(current_value)
    if link_key:
      self.put(link_key, value) # self.put: could be another link.
    else:
      super(SymlinkDatastore, self).put(key, value)
1313025
protected function doCreateSymlink() {
    $symlink = $this->getInstallationDirectory() . '/' . $this->getProjectName();
    $this->write('Symlink project at <comment>%s</comment>', $this->shortenDirectory($symlink));
    $this->fs->relativeSymlink($this->getProjectDirectory(), $symlink);
  }
1292084
def make_links(self):
        
        for dep in self.deps:
            filepaths, exts = dep.get_filepaths_and_exts()

            for path, ext in zip(filepaths, exts):
                logger.info("Need path %s with ext %s" % (path, ext))
                dest = self.ipath_from_ext(ext)

                if not os.path.exists(path):
                    # Try netcdf file.
                    # TODO: this case should be treated in a cleaner way.
                    path += ".nc"
                    if os.path.exists(path): dest += ".nc"

                if not os.path.exists(path):
                    raise self.Error("%s: %s is needed by this task but it does not exist" % (self, path))

                if path.endswith(".nc") and not dest.endswith(".nc"): # NC --> NC file
                    dest += ".nc"

                # Link path to dest if dest link does not exist.
                # else check that it points to the expected file.
                logger.debug("Linking path %s --> %s" % (path, dest))
                if not os.path.exists(dest):
                    os.symlink(path, dest)
                else:
                    # check links but only if we haven't performed the restart.
                    # in this case, indeed we may have replaced the file pointer with the
                    # previous output file of the present task.
                    if os.path.realpath(dest) != path and self.num_restarts == 0:
                        raise self.Error("\nDestination:\n %s\ndoes not point to path:\n %s" % (dest, path))
63682
def symlink(self, source, target):
        ''

        return self.operations('symlink', target.decode(self.encoding),
                                          source.decode(self.encoding))
491402
def StringizeLibSymlinks(symlinks):
    """"""
    if SCons.Util.is_List(symlinks):
        try:
            return [ (k.get_path(), v.get_path()) for k,v in symlinks ]
        except (TypeError, ValueError):
            return symlinks
    else:
        return symlinks
608870
def create_system(self):
        """"""
        return System(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
92137
def recursive_symlink_dirs(source_d, destination_d):
    '''
    
    '''
    func = os.symlink
    if os.name == 'nt':
        # NOTE: need to verify that default perms only allow admins to create
        # symlinks on Windows
        func = shutil.copy
    if os.path.exists(destination_d):
        os.rmdir(destination_d)
    shutil.copytree(source_d, destination_d, copy_function=func)
556126
protected function symlinkPublicDirectory()
    {
        if (! file_exists(public_path('themes/'.$this->getCurrent()))) {
            if (! file_exists(public_path('themes'))) {
                app()->make('files')->makeDirectory(public_path('themes'));
            }

            app()->make('files')->link(
                $this->path('public'), public_path('themes/'.$this->getCurrent())
            );
        }
    }
1067777
def _make_executable(path):
    """"""
    os.chmod(path, os.stat(path).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
923015
function setupSymlinks (module, modulesDir, callback) {

    let details = module.split('/');
    let modulePath = resolve(NODE_MODULES, details[1]);
    let devModulePath = resolve(modulesDir, module);

    rimraf(modulePath, err => {

        if (err) {
            return callback(err);
        }

        fs.symlink(devModulePath, modulePath, err => {

            if (err) {
                return callback(err);
            }

            callback();
        });
    });
}