[REBOL] rebol file paths
From: arolls::idatam::com::au at: 5-Nov-2001 17:56
I just discovered an interesting property of
rebol file paths. Have a look at this console
session:
>> what-dir ; == %/E/dev/rebol/view/local/
>> clean-path %/ ; reading this will list all your volumes
== %/
>> clean-path %// ; the root of your current directory
== %/E/
>> clean-path %/// ; the next directory along the path
== %/E/dev/ ; of your current directory
>> clean-path %//// ; etc
== %/E/dev/rebol/
>> clean-path %/////
== %/E/dev/rebol/view/
>> clean-path %//////
== %/E/dev/rebol/view/local/
>> clean-path %/////// ; of course, going a bit too far...
** Access Error: Bad file path: ///////
** Where: clean-path
** Near: get-modes target 'full-path
>> clean-path %//////../
== %/E/dev/rebol/view/
This also works for another volume.
Could be useful. Mmm.
I also noticed that rename cannot handle absolute
paths. It needs relative paths.
This is useful to know if you want to implement a
fast
file move function (on the same volume).
Anton.