Return the file name without extension.

    Examples: ::

        /foo/bar.baz => bar
        /foo/bar     => bar
        None         => None

    :param string path: the file path
    :rtype: string
178520
def file_name_without_extension(path):
    
    if path is None:
        return None
    return os.path.splitext(os.path.basename(path))[0]
1341501
private static final String getFileName(String path) {
        int index = path.lastIndexOf('/');//stop using File.separatorChar as we are not even remotely close to be using that ANYwhere else - apparently. This makes it fail on Windows systems
        int prefixLength = prefixLength(path);
        if (index < prefixLength) return path.substring(prefixLength);
        return path.substring(index + 1);
    }
47212
def extname(path, **kwargs):
    """"""
    import os.path
    name, ext = os.path.splitext(path, **kwargs)
    return ext
34748
private static String __getExtension(String path) {

        for (int i = path.length() - 1; i >= 0; i--) {
            if (path.charAt(i) == '.') {
                return path.substring(i + 1);
            }
        }

        return "";
    }
894653
def getfullfilename(file_path):
        ''' 
        '''
        warnings.warn("getfullfilename() is deprecated and will be removed in near future. Use chirptext.io.write_file() instead", DeprecationWarning)
        if file_path:
            return os.path.basename(file_path)
        else:
            return ''
590511
def BasenamePath(self, path):
    
    if path.endswith(self.PATH_SEPARATOR):
      path = path[:-1]
    _, _, basename = path.rpartition(self.PATH_SEPARATOR)
    return basename
229943
def _path_insensitive(path):
    
    path = str(path)
    if path == '' or os.path.exists(path):
        return path

    base = os.path.basename(path)  # may be a directory or a file
    dirname = os.path.dirname(path)

    suffix = ''
    if not base:  # dir ends with a slash?
        if len(dirname) < len(path):
            suffix = path[:len(path) - len(dirname)]

        base = os.path.basename(dirname)
        dirname = os.path.dirname(dirname)

    if not os.path.exists(dirname):
        dirname = _path_insensitive(dirname)
        if not dirname:
            return

    # at this point, the directory exists but not the file

    try:  # we are expecting dirname to be a directory, but it could be a file
        files = os.listdir(dirname)
    except OSError:
        return

    baselow = base.lower()
    try:
        basefinal = next(fl for fl in files if fl.lower() == baselow)
    except StopIteration:
        return

    if basefinal:
        return os.path.join(dirname, basefinal) + suffix
    else:
        return
355417
def from_path(path):
        '''
        
        '''
        if os.path.isdir(path):
            return DirectoryInfo(path)

        if os.path.isfile(path):
            return FileInfo(path)

        return None
1167205
public static String basename(String path)
  {
    return path != null ? basename(new File(path)) : null;
  }
1331096
@Nullable
  public static String getFilename(@Nullable final String path) {
    if (path == null) {
      return null;
    }

    final int separatorIndex = path.lastIndexOf(StringUtils.FOLDER_SEPARATOR);
    return separatorIndex != -1 ? path.substring(separatorIndex + 1) : path;
  }
194768
def _PathStripPrefix(self, path):
    
    if path.startswith('\\\\.\\') or path.startswith('\\\\?\\'):
      if len(path) < 7 or path[5] != ':' or path[6] != self._PATH_SEPARATOR:
        # Cannot handle a non-volume path.
        return None

      path = path[7:]

    elif path.startswith('\\\\'):
      # Cannot handle an UNC path.
      return None

    elif len(path) >= 3 and path[1] == ':':
      # Check if the path is a Volume 'absolute' path.
      if path[2] != self._PATH_SEPARATOR:
        # Cannot handle a Volume 'relative' path.
        return None

      path = path[3:]

    elif path.startswith('\\'):
      path = path[1:]

    else:
      # Cannot handle a relative path.
      return None

    return path
871803
def str_from_file(path):
    
    with open(path) as f:
        s = f.read().strip()
    return s
246763
def _get_suffix(path):
    
    suffix = os.path.basename(path).split(".")[-1]

    if "/" in suffix:
        raise UserWarning("Filename can't contain '/' in suffix (%s)!" % path)

    return suffix
1165532
def match_path_extname(path, extensions)
      basename = File.basename(path)

      i = basename.index('.'.freeze)
      while i && i < basename.length - 1
        extname = basename[i..-1]
        if value = extensions[extname]
          return extname, value
        end

        i = basename.index('.'.freeze, i+1)
      end

      nil
    end
1001397
def get_file_extension(file_path):
    
    _ext = os.path.splitext(file_path)[-1]
    if _ext:
        return _ext[1:] if _ext.startswith('.') else _ext

    return ""
1320104
public static String getFilenameExtension(String path) {
        if (path == null) return null;

        int extIndex = path.lastIndexOf(EXTENSION_SEPARATOR);
        if (extIndex == -1) return null;

        int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
        if (folderIndex > extIndex) return null;

        return path.substring(extIndex + 1);
    }
426703
def get_backup_filename(self, path):
		
		head = datetime.utcnow().replace(tzinfo=pytz.UTC).strftime("%Y%m%d%H%M%S")
		self.backup = "stations/backup/%s.%s" % (head, path)
		return self.backup