7stud -- wrote: > Edouard Dantes wrote: >> Hi, >> >> I try to copy files that match a certain pattern to another dir, i write >> >> cp_r /\/downloads\/bsd/i, "~/biblio/bsd/" >> >> if i can use regex to do this > I did some more testing and FileUtils seems pretty buggy to me. For instance, if my ruby program is in this directory: /Users/me/2testing/dir1 and I execute these two commands: cp_r ("/Users/me/downloads/bsd", "./test_dir") cp_r("/Users/me/2testing/dir1/downloads/bsd", "./test_dir") and the respective directories contain these files: /Users/me/downLOads/bSd/test1.txt /Users/me/2testing/dir1/DownloadS/BSd/test2.txt Then I get these results: .....dir1 .........test_dir ..............test2.txt ..............bsd ...................test1.txt According to the FileUtils docs: ---- If src is a directory, this method copies all its contents recursively. If dest is a directory, copies src to +dest/src+. ---- So I would have expected test1.txt to be copied to the directory: /Users/me/2testing/dir1/test_dir/Users/me/downloads/bsd And test2.txt to be copied to the directory: /Users/me/2testing/dir1/test_dir/Users/me/2testing/dir1/downloads/bsd -- Posted via http://www.ruby-forum.com/.