JSDOC/Packer.js
[app.jsdoc] / File.js
diff --git a/File.js b/File.js
index c21c6ff..f7ae90c 100755 (executable)
--- a/File.js
+++ b/File.js
@@ -22,7 +22,7 @@ var File = {
     
     /**
      * @static
-     * @property {String} File seperator. (should be dynamic....)
+     * @type {String} File seperator. (should be dynamic....)
      */
      
     
@@ -68,6 +68,29 @@ var File = {
         
         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.