Copyright ® (1999-2005) EDMGROUP Pty Ltd - EZY Prolog Reference

 filenamereduce

[This is preliminary specification and subject to change.]

Group

Prolog predicates  (more...)

Type

determ

Syntax

filenamereduce( STRING FILENAME, STRING BASEDIRECTORY, STRING REDUCEDNAME)

Flow patterns

(i,i,o)

 

Description:

Return the reduced filename with the sub-path, if any, from the specified BaseDirectory
Remarks
FullFileName  an input filename with a path. It is not required that the path should start with a device name; it can start from any subdirectory.
BaseDirectory  an input base directory name. Notice that the last backslash (doubled) character in a directory name can be omitted.
educedFileName  is the output argument. It returns the filename with the calculated relative sub-path from the BaseDirectory.
Notice that filenamereduce is pure string handling predicate and it does not check the correctness of the specified file and path names
In the simplest case, when filenamepath can unify all BaseDirectory with root of FullFileName, then it works according to the following formula:
\tReducedFileName = FullFileName - BaseDirectory

Sample:

No sample

Copyright © 1997-2005 EDMGROUP (Australia)