function move(source, target, callback)
{
  mount.mount(target, mount.MS_MOVE, {devFile: source}, function(error)
  {
    if(error) return callback(error)

    fs.readdir(source, function(err, files)
    {
      if(err) return callback(err)

      if(files.length) return callback()

      fs.rmdir(source, callback)
    })
  })
}
/**
 * Asynchronously move a subtree.
 *
 * The source specifies an existing mount point and target specifies the new
 * location. The move is atomic: at no point is the subtree unmounted. The
 * filesystemtype, mountflags, and data arguments are ignored.
 *
 * @example
 *   move('source/path', 'target/path', function(err) {})
 * @see For more Information please visit
 * {@link https://github.com/NodeOS/nodeos-mount#mountmountsource-target-fstype-options-datastr-callback|this}
 * site
 *
 * @param {String}   source   The source subtree to move
 * @param {String}   target   The path to move the subtree into
 * @param {Function} callback Function called after the mount operation finishes.
 *                            Receives only one argument err.
 */
Asynchronously move a subtree.
The source specifies an existing mount point and target specifies the new
location. The move is atomic: at no point is the subtree unmounted. The
filesystemtype, mountflags, and data arguments are ignored.



@param {String}   source   The source subtree to move
@param {String}   target   The path to move the subtree into
@param {Function} callback Function called after the mount operation finishes.
Receives only one argument err.
Asynchronously move a subtree . The source specifies an existing mount point and target specifies the new location . The move is atomic : at no point is the subtree unmounted . The filesystemtype mountflags and data arguments are ignored . @param { String } source The source subtree to move @param { String } target The path to move the subtree into @param { Function } callback Function called after the mount operation finishes . Receives only one argument err .
function move(source, target, callback)
{
  mount.mount(target, mount.MS_MOVE, {devFile: source}, function(error)
  {
    if(error) return callback(error)
    fs.readdir(source, function(err, files)
    {
      if(err) return callback(err)
      if(files.length) return callback()
      fs.rmdir(source, callback)
    })
  })
}
function move ( source , target , callback ) { mount . mount ( target , mount . MS_MOVE , { devFile : source } , function ( error ) { if ( error ) return callback ( error ) fs . readdir ( source , function ( err , files ) { if ( err ) return callback ( err ) if ( files . length ) return callback ( ) fs . rmdir ( source , callback ) } ) } ) }
Asynchronously move a subtree.
Asynchronously move a subtree .