[Index for tmp_for_tar/misc] [Return to Master Index]

filename_path

(tmp_for_tar/misc/filename_path.m)


Function Synopsis

p = filename_path( fname )

Help text

       p = filename_path( fname )

  Returns the path -- whatever is before the last slash ("/") in fname.
  Returns "" if fname contains no slash.

  If fname is a directory, p will be its parent directory.

  Derived from Andy Adler's imread.m.

 Last modified: April 2001



Listing of function file tmp_for_tar/misc/filename_path.m

##       p = filename_path( fname )
##
##  Returns the path -- whatever is before the last slash ("/") in fname.
##  Returns "" if fname contains no slash.
##
##  If fname is a directory, p will be its parent directory.
##
##  Derived from Andy Adler's imread.m.
##

## Author:        Etienne Grossmann  <etienne@isr.ist.utl.pt>
## Last modified: April 2001

function p = filename_path( fname )
  
  p = "" ;

  if nargin < 1, return ; end

  s = max (find (fname=="/")); 
  if ! isempty(s), 
    p = fname(1:s-1);
  end

Produced by oct2html on Sat Apr 28 21:14:54 2001
Cross-Directory links are: ON