File names changed

Discussion in 'Rebol' started by jsgrahamus, Jul 16, 2010.

  1. jsgrahamus

    jsgrahamus New Member

    I wrote a script which looped through a series of web pages, downloaded them and saved them off as files. Easy enough. After verifying that the code worked I changed the code into a function, so I could simply pass some parameters and not have to change the internals.

    What is happening now is that the file is being changed somehow from what I created to the same with "/c/program files (x86)/rebol/view/" appended to the front of it.

    The script follows with the error:
    >> basefile
    == %/c/users/steve/documents/bom/
    >> bom: func [book numch] [
    [ basefile: %c/users/steve/documents/bom/
    [ for counter 1 numch 1 [
    [ addr: rejoin [http://scriptures.lds.org/en/ book "/" counter]
    [ afile: rejoin [basefile book "/" book counter ".htm"]
    [ print afile
    [ print ""
    [ write afile (read addr)
    [ ]
    [ ]
    >> bom "alma" 63
    c/users/steve/documents/bom/alma/alma1.htm

    connecting to: scriptures.lds.org
    ** Access Error: Cannot open /c/program files (x86)/rebol/view/c/users/steve/documents/bom
    /alma/alma1.htm
    ** Where: do-body
    ** Near: write afile (read addr)

    Any clues on why it is changing the file path?


    Thanks, Steve
  2. jsgrahamus

    jsgrahamus New Member

    Solved: File names changed

    I should have set the file name to %/c/users... instead of what I did.
  3. Graham

    Graham Developer Staff Member

    Hi Steve

    I think you must be running into Vista/Windows 7 security issues where it is using the virtual file system.
    Move your script out of the c:\program files path to eg: c:\rebol and it should work.

    oh ... yeah .. you got that wrong!

    using relative path addressing.

Share This Page