Revision [1108]

This is an old revision of CommandXfile made by DavidLee on 2009-12-29 08:25:42.

 

Command xfile


Name

xfile file name manipulations



Synopsis

xfile [ serialization options ] [options] [filename [base]]

options are one of

-base
-b
basename of file without directory or extension
-basename
-B
basename of file with directory but without extension
-name
-n
name of file without directory
-fullname
-N name
exactly as given, including directory if present but converted to java format
-dir
-d
Directory component
-absolute
-a
absolute path
-cannonical
-c
cannonical path
-extension
-e
extension only including the "."
-uri
-u
outputs a file scheme URI
-sConverts the filename to local system notation otherwise outputs Java notation


Supports the standard [ serialization options ]

If [filename] is ommitted the current directory is used
if [base] is provided then it is added as a new component to the filename prior to executing the options
If [base] is an absolute path (on windows this means a drive letter or UNC path, on unix starting with /) then
filename is ignored. This allows xfile to be used to conditionally resolve relative paths.




Description

Prints a component of a filename or path.

Example:
xfile -a foo.bar

Result
c:/work/dei/xmlsh/trunk/foo.bar


xfile -e $PWD/foo.bar

Result
.bar


Resolve a relative path
xfile /tmp foo/bar

Result
/tmp/foo/bar


Resolve a absoute path on windows
xfile /tmp c:/foo/bar


Result
c:/foo/bar



Windows Notes

On Windows systems, the output filename is converted to the Java notation unless the -s argument is given. This changes \ to / but preserves any drive letter.


Return Value

Returns 0 if the command executed successfully, 1 if there was an error.

Commands
CategoryCommands
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki