It's intentional that the master register programs that fail to
compile. The reason is to avoid cascade errors when the same module is
resolved repeatedly.
/ Martin Stjernholm, Roxen IS
Previous text:
>2004-07-08 10:04:
>Subject: Re: Inherited files being compiled
>--------------------------------------------------------------------
>I'll just send this e-mail to you directly. I'm not sure if I found the problem or not but it seems as if the unregister function inside of the master object is being called like it should. I did end up fixing the problem by calling the unregister function by my own means which I will show you below:
>
>//! This function is called when we want to clone an object
>object|int clone_object(string sFile)
>{
> /* Remove unneccesary parts */
> if(sFile[0] == '/')
> {
> sFile = sFile[1 ..];
> }
>
> /* Prepend the filename to include the path to Emage */
> sFile = "C:/EMAGE/" + sFile;
>
> /* Make sure the path is relevant to pike standards */
> sFile = normalize_path(sFile);
>
> if(programs[sFile])
> {
> return ((program)sFile)();
> }
>
> /* Check to make sure the file exists */
> if(file_stat(sFile))
> {
> program p = 0;
>
> mixed err = catch
> {
> p = compile_file(sFile);
> };
>
> if(err)
> {
> unregister(p);
>
> sscanf(sFile, "C:/EMAGE%s", sFile);
>
> Send("Error compiling " + sFile + ". Please fix any/all errors.\n");
> return 0;
> }
> else
> {
> /* Return the cloned object */
> return (p());
> }
> }
>
> /* Throw an error if file does not exist. */
> error("File " + sFile + " not found.\n");
>
> /* No file exists return 0 */
> return 0;
>}
>
>I hope this helps in one way or another. It seems to me as if the calling program to be compiled is not the one being unregistered by the compiler but yet the inherited file is the one being called. Just an off the wall idea. I am in no way a professional programmer. Thanks for your suggestion anyways though.
>
>"Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum" <10353(a)lyskom.lysator.liu.se> wrote:
>Try running pike with --autoreload.
>
>/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
>
>Previous text:
>>2004-07-08 02:15:
>>Subject: Inherited files being compiled
>>--------------------------------------------------------------------
>>I have what seems to be a simple problem but is causing me a huge headache. The problem is that if an inherited file does not compile it still adds that file to master->programs. Now I am not sure if that has anything to do with it but doesn't this cause the file not to be recompiled when called again? I am just wondering if there was a fix I could plug in so all i would have to do is make the fix, upload the file and carry on instead of having to restart the master.
>>
>>
>>
>>---------------------------------
>>Do you Yahoo!?
>>New and Improved Yahoo! Mail - 100MB free storage!
>>
>>
>> / Brevbäraren
>>
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Mail - Helps protect you from nasty viruses.
>
>
> / Brevbäraren
>