Skip to content
Prev 281035 / 398503 Next

folders of path - platform independent (repost)

On 11-12-28 4:30 PM, Ben quant wrote:
If you use the normalizePath() function with winslash="/", then all 
current platforms will return a path using "/" as the separator, so you 
could do something like

strsplit(normalizePath(filename, winslash="/"), "/")[[1]]

You need to be careful with normalizePath:  at least on Windows, it will 
not necessarily do what you wanted if the filename doesn't exist.

Duncan Murdoch