How can I access directories and files of an intranet in Windows using Rebol? How can 开发者_运维问答I read a file such as this? :
\\name\dir\sub-dir\file.ext
I have tried:
read %//name/dir/sub-dir/file.ext
but it does not work.
in your example, you map machines, but not the path to the actual file.
so it should be:
read %/machine-name/DISK/folder/path/[file.ext]
where [file.ext] is optional.
for example:
read %/mycomputer/C/Users/Default/Pictures/
but is the disk shared to begin with? note that with Windows 7 the system disk is still shared by default, using the C$ "system" share.
read %/mycomputer/C$/
works on my machine, out of the box, without any manual sharing on my part.
Note about windows machine browsing/remote access... it is possible that shares on remote machines are not available until you've browsed them within windows first. Browsing via the explorer creates some some sort of login certificate which is then used by all attempts at remote browsing by the current user.
Note that you cannot list the root shares of a machine in REBOL. So this is invalid:
read %/machine/
I use this way when I confused about file! types:
print read to-rebol-file "\\name\dir\sub-dir\file.ext"
which works always. So you can see the correct syntax is:
%/name/dir/sub-dir/file.ext
if you have spaces in folder names, try:
%"/name/dir/sub dir/file.ext"
should work as well.
And also try:
read file:/name/dir/sub-dir/
if you put file:///name/dir/ then it will try to search /name/dir/ under the current path.
精彩评论