contents   index   previous   next



SElib.splitFilename()

syntax:

SElib.splitFilename(filespec)

where:

filespec - string specification for a file. May be a full or partial path specification.

 

return:

object - structure containing the drive and directory, file, and extension information contained in filespec. The structure returned has the following properties:

 

.dir   directory name including leading drive

       spec and trailing slash (d:\dir1\dir2\)

.name  root name of file only (filename)

.ext   file extension with leading period (.ext)

 

The three properties returned are guaranteed not to be null.

 

The actual characters used, such as the slash, depend on the operating system.

 

description:

Break up a file specification, full or partial path specification, into its component parts: drive and directory, filename, and extension. The filespec does not have to actually exist. This method merely divides up the filespec, as passed, according to the conventions of the operating system without checking to see if a drive, directory, or filename actually exists.

 

see:

SElib.fullpath(), File splitName(), File object in fileobj.jsh

 

example:

   // After splitting a filespec,

   // the following statement will

   // reconstruct it

var parts = SElib.splitFilename(MySpec);

var FileSpec = MySpec.dir + MySpec.name + MySpec.ext;

 


SElib.subclassWindow()