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
Only problem I see is that you are going to get false positives if
the file actually IS a shell script. You might try nibbling a little
more to get something Metacard/Rev specific.
Also, I know the file format has changed a couple of times in recent
history -- you might need to check if
Sorry. Ignore my first try. It fails already. (-:
Dave
___
metacard mailing list
metacard@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/metacard
Hi Hugh
Usual technique to seek extra time from a client is to ask more
questions. :-)
I assume the string has to match on the start of a word boundary.
e.g.
put This is a test. into sourceText (note the punctuation)
whole(is is a test,sourceText) = FALSE
Case-sensitivity?
Dave
On
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
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
Hi Dave,
Case sensitivity is an optional extra (although international should, if
possible, be handled for those who use accents). Depends on how brave you are
feeling. :-))
Challenge reminder...
put This is a test-piece. into sourceText (note the punctuation and
hyphen)
whole(This is a
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
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
Hi Hugh
I think I wrote those mails a long time ago from the wrong address
and they've just been allowed through now.
Sorry if they prompted you to respond.
Cheers
Dave
Hi Dave,
Case sensitivity is an optional extra (although international
should, if
possible, be handled for those
Hi Hugh
I think I wrote those mails a long time ago from the wrong address
and they've just been allowed through now.
Sorry if they prompted you to respond.
Cheers
Dave
PS I think I just mailed again from the wrong address again. Expect
to see the same reply in a month or so. :-0
Hi
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
Hugh,
I had one last thought while reading this that might be a clever
approach. Read a little bit off the front of the currently running
stack (since you KNOW that's a valid stack) and compare it to the
file in question. The advantages are that you only have to read a
tiny bit of the
13 matches
Mail list logo