var File = {
/**
- * @scope File
+ * @static
+ * @type {String} File seperator. (should be dynamic....)
*/
return s;
},
+ /**
+ * Get the base name of a path.
+ * @param {String} path
+ * @returns {String} basename
+ */
+ basename : function(path)
+ {
+ return path.split(File.SEPARATOR).pop();
+ },
+
+ /**
+ * Get the directory name of a path. (could use Glib really)
+ * @param {String} path
+ * @returns {String} dirname
+ */
+ dirname : function(path)
+ {
+ var r = path.split(File.SEPARATOR)
+ r.pop();
+ return r.join(File.SEPARATOR);
+ },
+
+
/**
* Join a path with the Correct File seperator (unix only at present...)
* Takes a variable number of arguments, and joins them together.
/**
* write a string to file
- * @param path {String} File to write to
- * @param string {String} Contents of file.
+ * @param {String} pathFile to write to
+ * @param {String} string Contents of file.
*
*/
write : function (path, string) {
},
/**
* append a string to a file
- * @param path {String} File to write to
- * @param string {String} string to append to file.
+ * @param {String} path File to write to
+ * @param {String} string string to append to file.
*
*/
append : function (path, string) {
},
/**
* Delete a file.
- * @param path {String} File to remove
+ * @param {String} path File to remove
*/
remove : function (path)
{