r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Henrik
17-Apr-2008
[10239x2]
definitely not being saved
I'm suspecting a file lock problem, but if it was locked, one would 
think that REBOL would return an error on write.
[unknown: 5]
17-Apr-2008
[10241x2]
Yeah I think it would.
is some lines writing while others aren't?
Henrik
17-Apr-2008
[10243]
yes, it's always the same lines
[unknown: 5]
17-Apr-2008
[10244]
Change the order of the lines and see if the same lines fail.
Henrik
17-Apr-2008
[10245]
I was wondering why there was a "black hole" in the log where I expected 
something important to happen.
[unknown: 5]
17-Apr-2008
[10246]
Maybe even number them to see if there is a pattern to what lines 
are not being saved.
Henrik
17-Apr-2008
[10247x3]
good idea
ah
the 11th commandment: thou shalt not change-dir in the middle of 
a file save. :-)
[unknown: 5]
17-Apr-2008
[10250x2]
lol
its always something simple like that.
Henrik
17-Apr-2008
[10252]
and so easy to overlook. I'm glad that WRITE was innocent and just 
doing its job.
[unknown: 5]
17-Apr-2008
[10253]
Me also.
Henrik
17-Apr-2008
[10254]
perfect. bug fixed.
[unknown: 5]
17-Apr-2008
[10255]
woohoo!
Henrik
17-Apr-2008
[10256]
now I can look at the bug I was originally going to fix...
Henrik
21-Apr-2008
[10257x5]
are there any limitations for renaming dirs? I keep getting access 
error, whenever I try it on OSX even when the permissions are 777.
and I'm sure the dir is not in use, since I can delete it just fine
never mind figured it out
interesting. the help states that the target must not be a path and 
that the function can't be used to move files, but if I supply a 
relative path as target as part of the new name, the file is in fact 
moved to the target under the new name. is that intentional?
sorry, forgot to say, it's the RENAME function
Anton
21-Apr-2008
[10262]
I don't know the answer, Henrik, but since you mention it, I really 
think that the act of moving a file should be invoked by a function 
named something like "MOVE" or "MOVE-FILE", regardless of whether 
its implementation in the OS is by a "rename" function.
Henrik
21-Apr-2008
[10263]
Anton, I haven't tested it under Windows though, so it could be a 
Linux/OSX side effect since rename usually equals move here.
Anton
21-Apr-2008
[10264]
Yes, POSIX rename can do moves:
http://en.wikipedia.org/wiki/Rename_(C)
Henrik
21-Apr-2008
[10265]
but I agree that a rename should behave identically under all OSes 
and that move should be a separate function.
Gregg
21-Apr-2008
[10266]
Post it as a question for Carl. I imagine it's an implementation 
side effect.
Anton
21-Apr-2008
[10267]
I think I know what the trouble is - it's not easy to know whether 
a host OS rename can support move or not. Therefore rebol can't choose 
beforehand between rename and copy+delete.

A workaround to that might be to try the rename first and see if 
it works (does not return an error message), but that adds complexity 
and performance problems. It could be done once at rebol startup 
in a temp directory, though it still seems a bit messy.

(The real solution seems to be to go back in time and define POSIX 
rename and move properly.)
Henrik
25-Apr-2008
[10268]
anyone have an idea on when and why exactly system/options/script 
is none? I'm running a simple script in OSX, and it seems to always 
return none.
BrianH
25-Apr-2008
[10269x2]
It is none when you are running at the top level interpreter.
In theory, it shouldn't be none during the running of a script.
Henrik
25-Apr-2008
[10271x2]
not sure I understand why that is so
well, it is none here in my tests. rather useless, I think.
BrianH
25-Apr-2008
[10273]
When you are running the REBOL interpreter straight, you are not 
running a script, so it is none. This can be useful to know.
Henrik
25-Apr-2008
[10274x3]
by straight, you mean, I'm typing system/options/script in the console? 
because that's not what I'm doing. I'm running a script that probes 
that path and it returns none.
or do you mean, it returns none, when you say "do %script.r" ?
rather than "rebol -qs script.r"?
BrianH
25-Apr-2008
[10277x2]
Yes.
You probably want to be looking at system/script instead.
Henrik
25-Apr-2008
[10279x2]
system/script doesn't tell the name of the script.
I had hoped to be at any time able to identify the running script 
by filename
BrianH
25-Apr-2008
[10281]
I believe that is what the file: header field is for.
Henrik
25-Apr-2008
[10282x2]
the trouble is that the header information may not be correct
and File: also says none
BrianH
25-Apr-2008
[10284x2]
You set the File: header in the script. For that matter, since the 
check of the script settings is specific to the currently running 
script, you have to add them to the script anyways, so why not correct 
the header while you're at it?
Another interesting one is the Content: header. Try this script:
REBOL [content: true] print mold system/script
Henrik
25-Apr-2008
[10286x2]
still returns none.
but my issue is that I have over 100 scripts for this project. there 
might be an error in one of them, if I forget changing the header 
when cloning a script. If it really is impossible for rebol to determine 
the script name (which I highly doubt), then so be it, but it's inconvenient 
not to have the script name available at all times.
BrianH
25-Apr-2008
[10288]
I said Content: would be interesting, not that it would solve your 
problem.