swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp Serialization: GZ support?


From: Alex Lancaster
Subject: Re: Lisp Serialization: GZ support?
Date: 17 Mar 2002 18:31:12 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

>>>>> "PJ" == Paul Johnson <address@hidden> writes:

PJ> OK, I'm experimenting and run into one problem. I was using
PJ> Swarm's mode argument to give a file name, and no matter what I
PJ> do, Swarm disregards the period and the suffix to the file
PJ> name. It sees

PJ> ./ex -m test.scm.gz and the mode string is just "test".

PJ> Is that intended?

Yes, because the mode string is supposed to only be for modes for the
archiver (not filenames!!) which should not contain periods.  The
relevant code is this in Arguments.m:

static const char *
getApplicationValue (const char *val)
{
  const char *appStr;
  {
    const char *ptr;
    
    appStr = val;
    ptr = (char *)appStr;
    while (*ptr)
      {
        if (*ptr == '/')
          appStr = ptr + 1;
        ptr++;
      }
  }
  {
    char *newStr = SSTRDUP (appStr);
    char *ptr = newStr;
    
    ptr = newStr;
    while (*ptr)
      {
        if (*ptr == '.')
          {
            *ptr = '\0';
            break;
          }
        ptr++;
      }
    return (const char *)newStr;
  }
}

When it encounters a period, the loop while loop above will terminate,
returning only the part up until it encounters the period.

I think you're trying to use the "-m" option as a shortcut so you
don't have to write your own parsing routine.  If so, don't.
Overwriting an the "-m / --mode" option to do something else (unless
you completely understand all the ramifications and use of that option
in Swarm) is definitely Not The Right Thing and inevitably leads to
confusion and perhaps madness... ;-)

If you want to use an option for passing a filename, then you should
add your own option and write the code for parsing that and you can
ensure that you use the entire filename to pass to the decompression
routine.

However, I agree that the "no period in mode" behaviour should
probably be documented somewhere.  I will check a change into CVS when
I can.

A.
-- 
  Alex Lancaster           |  
  Swarm Development Group  |     web: http://www.swarm.org
-------------------------------------------------------------------

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]