Returns the local work directory.
12559
public static PathImpl getLocalWorkDir(ClassLoader loader)
  {
    PathImpl path = _localWorkDir.get(loader);

    if (path != null)
      return path;
    
    path = getTmpWorkDir();

    _localWorkDir.setGlobal(path);
    
    try {
      path.mkdirs();
    } catch (java.io.IOException e) {
    }

    return path;
  }
502467
def GetLocalPath(self, inode, cache, database):
    
    local_path = cache.GetResults('local_path')
    if not local_path:
      results = database.Query(self.LOCAL_PATH_CACHE_QUERY)

      cache.CacheQueryResults(
          results, 'local_path', 'child_inode_number',
          ('parent_inode_number', 'filename'))
      local_path = cache.GetResults('local_path')

    parent, path = local_path.get(inode, [None, None])

    # TODO: Read the local_sync_root from the sync_config.db and use that
    # for a root value.
    root_value = '%local_sync_root%/'

    if not path:
      return root_value

    paths = []
    while path:
      paths.append(path)
      parent, path = local_path.get(parent, [None, None])

    if not paths:
      return root_value

    # Paths are built top level to root so we need to reverse the list to
    # represent them in the traditional order.
    paths.reverse()
    return root_value + '/'.join(paths)
1194110
def get_data_dir():
    """"""
    base_odl_dir = os.environ.get('ODL_HOME', expanduser(join('~', '.odl')))
    data_home = join(base_odl_dir, 'datasets')
    if not exists(data_home):
        os.makedirs(data_home)
    return data_home
23615
def get_local_filepath(filename):
    
    procs_dir = os.path.normpath(os.path.join(
        __file__,
        '../../',
        'external/postgresql/raw_sql/procs'
    ))
    return os.path.join(procs_dir, filename)
1334499
def directory(self):
        """"""
        if self._directory is None:
            return self.service_group.hitch_dir.hitch_dir
        else:
            return self._directory
720811
def create_local_module_dir(cache_dir, module_name):
  """"""
  tf_v1.gfile.MakeDirs(cache_dir)
  return os.path.join(cache_dir, module_name)
630921
public static Path getLocalCache(URI cache, Configuration conf, Path subdir,
      FileStatus fileStatus, boolean isArchive, long confFileStamp, Path
      currentWorkDir, boolean honorSymLinkConf, MRAsyncDiskService
      asyncDiskService, LocalDirAllocator lDirAllocator)
  throws IOException {
    return getLocalCache(cache, conf, subdir, fileStatus, isArchive,
        confFileStamp, fileStatus.getLen(), currentWorkDir, honorSymLinkConf,
        asyncDiskService, lDirAllocator);
  }
452173
Locale getWorkplaceLocale() {

        if (m_wpLocale == null) {
            m_wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
        }
        return m_wpLocale;
    }
556521
def get_profile_dir ():
    """"""
    basedir = unicode(os.environ["HOME"])
    return os.path.join(basedir, u"Library", u"Safari")
921506
def directory(self):
        """"""
        if not self.is_directory:
            msg = 'This task is a file task with no associated directory.'
            raise TaskError(msg)
        if self._directory is None:
            if self.is_transferred:
                self._directory = self.api._load_directory(self.cid)
        if self._directory is None:
            msg = 'No directory assciated with this task: Task is %s.' % \
                self.status_human.lower()
            raise TaskError(msg)
        return self._directory
590930
def __set_workdir(self):
        """"""
        fname = self.get_current_filename()
        if fname is not None:
            directory = osp.dirname(osp.abspath(fname))
            self.open_dir.emit(directory)
818429
Path[] getLocalFiles(JobConf conf, String subdir) throws IOException{
    String[] localDirs = getLocalDirsFromConf(conf);
    Path[] paths = new Path[localDirs.length];
    FileSystem localFs = FileSystem.getLocal(conf);
    for (int i = 0; i < localDirs.length; i++) {
      paths[i] = new Path(localDirs[i], subdir);
      paths[i] = paths[i].makeQualified(localFs);
    }
    return paths;
  }
944345
Path[] getLocalDirs() throws IOException{
    String[] localDirs = getLocalDirsFromConf(fConf);
    Path[] paths = new Path[localDirs.length];
    FileSystem localFs = FileSystem.getLocal(fConf);
    for (int i = 0; i < localDirs.length; i++) {
      paths[i] = new Path(localDirs[i]);
      paths[i] = paths[i].makeQualified(localFs);
    }
    return paths;
  }
903753
private void postWorkDirectory() {

        // Acquire (or calculate) the work directory path
        String workDir = getWorkDir();
        if (workDir == null || workDir.length() == 0) {

            // Retrieve our parent (normally a host) name
            String hostName = null;
            String engineName = null;
            String hostWorkDir = null;
            Container parentHost = getParent();
            if (parentHost != null) {
                hostName = parentHost.getName();
                if (parentHost instanceof StandardHost) {
                    hostWorkDir = ((StandardHost)parentHost).getWorkDir();
                }
                Container parentEngine = parentHost.getParent();
                if (parentEngine != null) {
                   engineName = parentEngine.getName();
                }
            }
            if ((hostName == null) || (hostName.length() < 1))
                hostName = "_";
            if ((engineName == null) || (engineName.length() < 1))
                engineName = "_";

            String temp = getBaseName();
            if (temp.startsWith("/"))
                temp = temp.substring(1);
            temp = temp.replace('/', '_');
            temp = temp.replace('\\', '_');
            if (temp.length() < 1)
                temp = ContextName.ROOT_NAME;
            if (hostWorkDir != null ) {
                workDir = hostWorkDir + File.separator + temp;
            } else {
                workDir = "work" + File.separator + engineName +
                    File.separator + hostName + File.separator + temp;
            }
            setWorkDir(workDir);
        }

        // Create this directory if necessary
        File dir = new File(workDir);
        if (!dir.isAbsolute()) {
            String catalinaHomePath = null;
            try {
                catalinaHomePath = getCatalinaBase().getCanonicalPath();
                dir = new File(catalinaHomePath, workDir);
            } catch (IOException e) {
                logger.warn(sm.getString("standardContext.workCreateException",
                        workDir, catalinaHomePath, getName()), e);
            }
        }
        if (!dir.mkdirs() && !dir.isDirectory()) {
            logger.warn(sm.getString("standardContext.workCreateFail", dir,
                    getName()));
        }

        // Set the appropriate servlet context attribute
        if (context == null) {
            getServletContext();
        }
        context.setAttribute(ServletContext.TEMPDIR, dir);
//        context.setAttributeReadOnly(ServletContext.TEMPDIR);
    }
66357
def git_working_dir(func):
    """"""

    @wraps(func)
    def set_git_working_dir(self, *args, **kwargs):
        cur_wd = os.getcwd()
        os.chdir(self.repo.working_tree_dir)
        try:
            return func(self, *args, **kwargs)
        finally:
            os.chdir(cur_wd)
        # END handle working dir
    # END wrapper

    return set_git_working_dir
586269
def get_local_file_list(self):
        
        file_list = []
        for (dirpath, dirnames, filenames) in os.walk(self.build_dir):
            for fname in filenames:
                # relative path, to sync with the S3 key
                local_key = os.path.join(
                    os.path.relpath(dirpath, self.build_dir),
                    fname
                )
                if local_key.startswith('./'):
                    local_key = local_key[2:]
                file_list.append(local_key)
        return file_list
912132
private Path[] getMapFiles(FileSystem fs, boolean isLocal)
  throws IOException {
    List<Path> fileList = new ArrayList<Path>();
    if (isLocal) {
      // for local jobs
      for(int i = 0; i < numMaps; ++i) {
        fileList.add(mapOutputFile.getInputFile(i, getTaskID()));
      }
    } else {
      // for non local jobs
      for (FileStatus filestatus : mapOutputFilesOnDisk) {
        fileList.add(filestatus.getPath());
      }
    }
    return fileList.toArray(new Path[0]);
  }