Could you give an example of a 'before' and 'after' of a filename?

On Jul 20, 1:43 pm, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> I was wondering if someone could point out how to rename a file name.
>
> In the script I am using I see
>
> function fileFromPath(file){  
>   return file.replace(/.*(\/|\\)/, "");
>
> }
>
> which replaces characters.... but how would I completely rename the file
>
> I tried:
>
> function fileFromPath(file){
>
>      var dateObject = new Date();
>      var file =
>           dateObject.getFullYear() + '' +
>           dateObject.getMonth() + '' +
>          dateObject.getDate() + '' +
>           dateObject.getTime();
>
>      return file("");
>
>   //return file.replace(/.*(\/|\\)/, "");
>
> } but i lose the extension of the file
>
> Dave

Reply via email to