User Tools

Site Tools


syntax:functions:directory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
syntax:functions:directory [2021/07/31 01:44] craigtsyntax:functions:directory [2021/08/29 00:55] (current) craigt
Line 16: Line 16:
 =====Remarks===== =====Remarks=====
 Return values containing //only// a root path will include the trailing backslash while non-root paths will //not// include the trailing backslash.  See the "Examples" section below. Return values containing //only// a root path will include the trailing backslash while non-root paths will //not// include the trailing backslash.  See the "Examples" section below.
 +
 +When a relative reference is used in a rooted path, only the dot or double-dot is returned //without// the trailing backslash.  See the "Examples" section below.
  
  
Line 21: Line 23:
 =====Examples===== =====Examples=====
  
-  directory('C:\myproject.morph''C:\'  //Root paths include a backslash. +  directory('C:\myproject.morph' //Returns 'C:\'  (Root paths include a backslash.
-  directory('C:\Documents\myproject.morph''C:\Documents'  //No trailing backslash for non-root paths. + 
-  directory('C:\Documents\MyProjects\March\myproject.morph''C:\Documents\MyProjects\March'  //3 levels deep.+  directory('C:\Documents\myproject.morph' //Returns 'C:\Documents'  (No trailing backslash for non-root paths.
 + 
 +  directory('..\myproject.morph') //Returns '..' (Rooted relative reference excludes the backslash.) 
 + 
 +  directory('..\MyProjects\March\myproject.morph'//Returns '..\MyProjects\March' (Relative reference) 
 + 
 + 
 +\\  
 +=====See also===== 
 +  * [[syntax:functions:fileextension|FileExtension(full_path)]] 
 +  * [[syntax:functions:filename|FileName(full_path)]] 
  
syntax/functions/directory.txt · Last modified: 2021/08/29 00:55 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki