updating oE pathinfo

pathinfo

include filesys.e 
namespace filesys 
public function pathinfo(sequence path, integer std_slash = 0) 

parses a fully qualified pathname.

Parameters:
  1. path : a sequence, the path to parse
Returns:

A sequence, of length five. Each of these elements is a string:

  • The path name. For Windows this excludes the drive id.
  • The full unqualified file name
  • the file name, without extension
  • the file extension
  • the drive id
Comments:

The host operating system path separator is used in the parsing.

Example 1:
-- WINDOWS 
info = pathinfo("C:\\euphoria\\docs\\readme.txt") 
-- info is {"C:\\euphoria\\docs", "readme.txt", "readme", "txt", "C"} 
Example 2:
-- Unix variants 
info = pathinfo("/opt/euphoria/docs/readme.txt") 
-- info is {"/opt/euphoria/docs", "readme.txt", "readme", "txt", ""} 
Example 3:
-- no extension 
info = pathinfo("/opt/euphoria/docs/readme") 
-- info is {"/opt/euphoria/docs", "readme", "readme", "", ""} 
See Also:

driveid, dirname, filename, fileext, PATH_BASENAME, PATH_DIR, PATH_DRIVEID, PATH_FILEEXT, PATH_FILENAME

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu