fileparts               package:matlab               R Documentation

_M_A_T_L_A_B _f_i_l_e_p_a_r_t_s _f_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Return filename parts.

_U_s_a_g_e:

     fileparts(pathname)

_A_r_g_u_m_e_n_t_s:

pathname: character string representing pathname to be parsed

_D_e_t_a_i_l_s:

     Determines the path, filename, extension, and version for the
     specified file. The returned 'ext' contains a dot (.) before the
     file extension. The returned 'versn' is always an empty string as
     the field is provided for compatibility with its namesake's
     results.

_V_a_l_u_e:

     Returns a list with components: 

 pathstr: character string representing directory path

    name: character string representing base of file name

     ext: character string representing file extension

   versn: character string representing version. Unused

_N_o_t_e:

     Returns same insane results as does its namesake when handling
     relative directories, UNIX hidden files, and tilde expansion.
     Hidden files are returned with 'name' containing a zero length
     vector and 'ext' containing the actual name. For best results, use
     this routine to process files, not directories.

_A_u_t_h_o_r(_s):

     P. Roebuck, roebuck@mdanderson.org

_S_e_e _A_l_s_o:

     'fullfile'

_E_x_a_m_p_l_e_s:

     ## Rename dot-txt file as dot-csv
     ans <- fileparts("/home/luser/foo.txt")
     fullfile(ans$pathstr, paste(ans$name, ".csv", sep = ""))   # /home/luser/foo.csv

