On 01/20/2012 07:08 PM, Alex Sweps wrote:
> Hello Jeremy
> 
> I am not getting any errors, the script runs almost perfect but when i 
> check the folders the files are in the test folder. The contents of 
> test_files is an array of files that have been sorted. Its as if 
> FileUtils.mv cannot read the variables.
> 
> This is what is created successfully:
> Backup\test\2012\201201
> 
> When i move the files they end up in:
> Backup\test\
> leaving 2012 and 201201 folders empty.

This really isn't enough to go on, for me at least.  My guess is that
you're building the path slightly differently when you make the
directory structure than when you attempt to move files into it.  Try
creating the path string just 1 time, storing that string into a
variable and then using that variable everywhere you need the path string.

You can also try running the FileUtils.mv method in verbose mode by
passing :verbose => true as the last argument:

http://rubydoc.info/stdlib/fileutils/1.9.2/FileUtils:mv

Another thing to try is printing the arguments you're passing to the
FileUtils.mv method and eyeballing the output to see if anything jumps
out at you as suspicious.

Finally, if all else fails, you can try calling FileUtils.mv with hard
coded strings that you believe to be equivalent to what you're passing
in normally to see if the behavior changes.

-Jeremy