Changes the remote current working directory.
514855
public void changeDir(String dir)
        throws IOException, ServerException {
        if (dir == null) {
            throw new IllegalArgumentException("Required argument missing");
        }
        Command cmd = new Command("CWD", dir);
        try {
            controlChannel.execute(cmd);
        } catch (FTPReplyParseException rpe) {
            throw ServerException.embedFTPReplyParseException(rpe);
        } catch (UnexpectedReplyCodeException urce) {
            throw ServerException.embedUnexpectedReplyCodeException(
                                urce,
                                "Server refused changing directory");
        }
    }
1219032
public function remoteDirectory($directory, $physical = false)
    {
        $this->remoteDir = $directory;
        $this->physicalRemoteDir = $physical;

        return $this;
    }
470131
def _update_dirs_on_base(self):
        ''''''
        if self._dirs['base'] != None:
            for d in self._predefined_dir_names:
                dstr = d
                #if d == "s2":
                #    dstr = '.'+d
                self._dirs[d] = os.path.join(self._dirs['base'], dstr)
386961
def set_outdir(self):
        """"""
        dirname = self.w.outdir.get_text()
        if os.path.isdir(dirname):
            self.outdir = dirname
            self.logger.debug('Output directory set to {0}'.format(self.outdir))
        else:
            self.w.outdir.set_text(self.outdir)
            self.logger.error('{0} is not a directory'.format(dirname))
869511
def rmdir(self):
        
        if self._closed:
            self._raise_closed()
        self._accessor.rmdir(self)
963588
def cd(self, remote):
        
        try:
            self.conn.cwd(remote)
        except Exception:
            return False
        else:
            return self.pwd()
1192852
protected function doRelocation()
    {
        if (!$this->_original) {
            return;
        }

        if (is_dir($this->_original->path())) {
            if ($this->_action === 'move') {
                Folder::move($this->_original->path(), $this->path());
            } elseif ($this->_action === 'copy') {
                Folder::copy($this->_original->path(), $this->path());
            }
        }

        if ($this->name() !== $this->_original->name()) {
            $path = $this->path();
            if (is_file($path . '/' . $this->_original->name())) {
                rename($path . '/' . $this->_original->name(), $path . '/' . $this->name());
            }
        }

    }
428671
def deploy_remote(self, dotfiles):
        """"""
        tempfile_path = None
        tempdir_path = None

        try:
            tempdir_path = tempfile.mkdtemp()
            self.log.debug('Deploying to temp dir %s', tempdir_path)
            self.deploy_local(dotfiles, target_root=tempdir_path)

            if self.args.rsync:
                local_spec = tempdir_path.rstrip('/') + '/'
                remote_spec = self.args.path.rstrip('/') + '/'

                if self.args.user:
                    remote_spec = "{0}@{1}:{2}".format(self.args.user,
                                                       self.args.server,
                                                       remote_spec)
                else:
                    remote_spec = "{0}:{1}".format(self.args.server,
                                                   remote_spec)

                self.log.debug('Using rsync to sync dotfiles to %s',
                               remote_spec)
                self.sh('rsync', '-az', local_spec, remote_spec)

            else:
                fh, tempfile_path = tempfile.mkstemp(suffix='.tar.gz')
                os.close(fh)

                self.log.debug('Creating tar file %s', tempfile_path)
                shutil.make_archive(tempfile_path.replace('.tar.gz', ''),
                                    'gztar', tempdir_path)

                upload_path = '_profile_upload.tgz'
                self.log.debug('Uploading tarball to %s', upload_path)
                self.scp(tempfile_path, upload_path)

                if self.args.path:
                    ssh_command = "'mkdir -p {0} && "\
                                  "tar xf _profile_upload.tgz -C {0}; "\
                                  "rm -f _profile_upload.tgz'"\
                                  "".format(self.args.path)
                else:
                    ssh_command = "tar xf _profile_upload.tgz; "\
                                  "rm -f _profile_upload.tgz"
                self.log.debug('Using ssh to unpack tarball and clean up')
                self.ssh(ssh_command)

        finally:
            if tempdir_path and path.isdir(tempdir_path):
                self.log.debug('Removing temp dir %s', tempdir_path)
                shutil.rmtree(tempdir_path)
            if tempfile_path and path.isfile(tempfile_path):
                self.log.debug('Removing temp file %s', tempfile_path)
                os.unlink(tempfile_path)
714198
def select_directory(self):
        """"""
        basedir = to_text_string(self.wd_edit.text())
        if not osp.isdir(basedir):
            basedir = getcwd_or_home()
        directory = getexistingdirectory(self, _(""), basedir)
        if directory:
            self.wd_edit.setText(directory)
            self.dir = directory
365238
def change_to_workdir(self):
        
        logger.info("Changing working directory to: %s", self.workdir)

        self.check_dir(self.workdir)
        try:
            os.chdir(self.workdir)
        except OSError as exp:
            self.exit_on_error("Error changing to working directory: %s. Error: %s. "
                               "Check the existence of %s and the %s/%s account "
                               "permissions on this directory."
                               % (self.workdir, str(exp), self.workdir, self.user, self.group),
                               exit_code=3)
        self.pre_log.append(("INFO", "Using working directory: %s" % os.path.abspath(self.workdir)))
330572
function resetModule() {
            function resetTernServer() {
                if (_ternNodeDomain.ready()) {
                    _ternNodeDomain.exec('resetTernServer');
                }
            }
            
            if (_ternNodeDomain) {
                if (addFilesPromise) {
                    // If we're in the middle of added files, don't reset 
                    // until we're done
                    addFilesPromise.done(resetTernServer).fail(resetTernServer);
                } else {
                    resetTernServer();
                }
            }
        }
761152
def relworkdir(self):
        """"""
        if getattr(self, "workdir", None) is None:
            return None
        try:
            return os.path.relpath(self.workdir)
        except OSError:
            # current working directory may not be defined!
            return self.workdir
750296
public static function changeOwnerAndMode()
    {
        $dirs = \Deployer\get('change_owner_mode_dirs');

        if (empty($dirs)) {
            return;
        }

        foreach ($dirs as $key => $dirData) {
            $dir = $dirData['dir'];
            $owner = $dirData['owner'];
            $mode = $dirData['mode'];

            \Deployer\run("sudo chown -RH $owner $dir");
            \Deployer\run("sudo chmod -R $mode $dir");
        }
    }
1029630
def change_dir(newdir):
    
    prevdir = os.getcwd()
    os.chdir(os.path.expanduser(newdir))
    try:
        yield
    finally:
        os.chdir(prevdir)
216972
def work_in(dirname=None):
    
    curdir = os.getcwd()
    try:
        if dirname is not None:
            os.chdir(dirname)

        requests_cache.configure(expire_after=60 * 10 * 10)
        changes.initialise()

        yield

    finally:
        os.chdir(curdir)
138221
def remote_delete(self, remote_path, r_st):
        """"""
        # If it's a directory, then delete content and directory
        if S_ISDIR(r_st.st_mode):
            for item in self.sftp.listdir_attr(remote_path):
                full_path = path_join(remote_path, item.filename)
                self.remote_delete(full_path, item)
            self.sftp.rmdir(remote_path)

        # Or simply delete files
        else:
            try:
                self.sftp.remove(remote_path)
            except FileNotFoundError as e:
                self.logger.error(
                    "error while removing {}. trace: {}".format(remote_path, e)
                )
516561
public static void resetBaseDirectoryLocation(){
        String property = System.getProperty(DL4JSystemProperties.DL4J_RESOURCES_DIR_PROPERTY);
        if(property != null){
            baseDirectory = new File(property);
        } else {
            baseDirectory = new File(System.getProperty("user.home"), ".deeplearning4j");
        }

        if(!baseDirectory.exists()){
            baseDirectory.mkdirs();
        }
    }