2 // Armadillo File Manager
3 // Copyright (c) 2011, Robert Sesek <http://www.bluestatic.org>
5 // This program is free software: you can redistribute it and/or modify it under
6 // the terms of the GNU General Public License as published by the Free Software
7 // Foundation, either version 3 of the License, or any later version.
18 // Takes a full file path and renames the last path component as if it were a
19 // TV episode. This performs the actual rename as well.
20 func RenameEpisode(inPath string) (*string, os.Error) {
21 // Make sure a path was given.
23 return nil, os.NewError("Invalid path")
25 // Check that it's inside the jail.
26 var path *string = paths.Verify(inPath)
28 return nil, os.NewError("Path is invalid or outside of jail")
30 // Make sure that the file exists.
31 fileInfo, err := os.Stat(*path)