Re: IsAstack ( )

2007-07-13 Thread Trevor DeVore
On Jul 13, 2007, at 1:29 AM, Chipp Walters wrote: So, what to do if there already is a stack with the same name open? Just curious, would this work? lock messages if there is a stack tStackPath then put true into tExists delete stack tStackPath else put false into tExists end if unlock

Re: IsAstack ( )

2007-07-13 Thread FlexibleLearning
Hi Trevor Renaming the mainstack temporarily before trying if there is a stack works fine, and I've not found a problem with substack collisions when using it. Since, as you say, the call loads into memory, the engine will figure out if it is incomplete or corrupted but it doesn't seem to

Re: IsAstack ( )

2007-07-13 Thread Trevor DeVore
On Jul 13, 2007, at 2:13 PM, David Bovill wrote: I have not found any problems with name space collision using the technique Chipp described. Locking messages and loading a stack with the same name into memory seems fine - you just remove it from memory using the file name (long stack

Re: IsAstack ( )

2007-07-13 Thread David Bovill
I have not found any problems with name space collision using the technique Chipp described. Locking messages and loading a stack with the same name into memory seems fine - you just remove it from memory using the file name (long stack name). I tested it quite a bit and routinely run through 40

Re: IsAstack ( )

2007-07-12 Thread Chipp Walters
I'm all for checking to see if a stack exists. Here's why. Many times a stack can be downloaded incompletely by a user for a variety of reasons. If you just check the filename, or the first 8 bytes, you may not know the stack is corrupted or incomplete. So, what to do if there already is a

Re: IsAstack ( )

2007-07-04 Thread David Bovill
On 02/07/07, Brian Yennie [EMAIL PROTECTED] wrote: Reading from a file should be perfectly safe even if it is in use - writing is the dangerous one. True - but I see no advantage over using the built in exists() function and removing the stack from memory afterwards - it is not subject to

Re: IsAstack ( )

2007-07-04 Thread Robert Brenstein
On 02/07/07, Brian Yennie mailto:[EMAIL PROTECTED][EMAIL PROTECTED] wrote: Reading from a file should be perfectly safe even if it is in use - writing is the dangerous one. True - but I see no advantage over using the built in exists() function and removing the stack from memory

Re: IsAstack ( )

2007-07-04 Thread Ken Ray
On Wed, 4 Jul 2007 12:45:04 +0100, David Bovill wrote: On 02/07/07, Brian Yennie [EMAIL PROTECTED] wrote: Reading from a file should be perfectly safe even if it is in use - writing is the dangerous one. True - but I see no advantage over using the built in exists() function and

IsAstack ( )

2007-07-02 Thread FlexibleLearning
I need a robust alternative to if there is a stack pFilePath that does *not* load the file into memory and potentially cause problems with shared stack name space. Can anyone improve or see anything not foolproof with this? function isAstack pFilePath return line 1 of url(file:pFilePath

Re: IsAstack ( )

2007-07-02 Thread Brian Yennie
I need a robust alternative to if there is a stack pFilePath that does *not* load the file into memory and potentially cause problems with shared stack name space. Can anyone improve or see anything not foolproof with this? function isAstack pFilePath return line 1 of url

Re: IsAstack ( )

2007-07-02 Thread Klaus Major
Hi Hugh, I need a robust alternative to if there is a stack pFilePath that does *not* load the file into memory and potentially cause problems with shared stack name space. Can anyone improve or see anything not foolproof with this? function isAstack pFilePath return line 1 of url

Re: IsAstack ( )

2007-07-02 Thread David Bovill
These are the functions I have: function stack_Exists someName -- will not add stack to memory set lockmessages to true put the mainstacks into stacksInMemory put empty into shortStackName if exists(stack someName) then put true into safeExistence put

Re: IsAstack ( )

2007-07-02 Thread FlexibleLearning
Hi Klaus, Brian, David: Good catches. I don't think I dare use open/read/close in case the file (and it could be any file) is in use, and testing the suffix is not always reliable (I am allowing data stacks to be suffix-less). Since I've never used a shell script, I'm not sure what

Re: IsAstack ( )

2007-07-02 Thread J. Landman Gay
David Bovill wrote: These are the functions I have: function stack_Exists someName -- will not add stack to memory set lockmessages to true put the mainstacks into stacksInMemory put empty into shortStackName if exists(stack someName) then I thought the exists() function opens

Re: IsAstack ( )

2007-07-02 Thread David Bovill
Yes it does - which is why the script deletes the stack from memory if it was not already loaded before hand. I use this script routinely when looping through indexes of stacks which may have been moved or deleted by hand, and wrote it to avoid the problem of loading everything into memory - I am

Re: IsAstack ( )

2007-07-02 Thread Brian Yennie
and not *only* in memory. function isAStack tFilePath ## the file path to the current stack put value(word 2 of the long name of this stack) into tStackPath ## nibble off the first 8 bytes open file tStackPath for binary read read from file tStackPath for 8 put it into myFirst8Bytes