Early in my R life I discovered the pain of R and windows being on different pages when it came to the separator between directories and subdirectories. Eventhough I know about
Not exactly the answer you're looking for but R has its own shell scripting functions which I often use:
list.files(,full=TRUE) [returns full path with appropriate separators]
file.path() [joins with OS-specific separator]
and so on...