[torqueusers] Directory with space in the name causes that no batch .e/.o files are copied

Bas van der Vlies basv at sara.nl
Thu Oct 11 05:46:21 MDT 2012


Hello,

 We see more and more users that have directories with spaces in it. I have installed torque 2.X and 4.X. Both versions do not
accept it. will this be fixed in a future releae. The problem is with the used function wordexp and that the characters that cause
the problem are not escaped. See:
  * "src/resmom/requests.c

Here is an example that works. The first invocation does not escape and see 3 words. The other see one file. To my knowledge
PBS_O_WORKDIR is already expanded.

{{{
#include <stdio.h>
#include <stdlib.h>
#include <wordexp.h>

int main(int argc, char **argv)
{
   wordexp_t p;
   char **w;
   int i;
   int r;

   r = wordexp("/home/bas/dir with spaces/file.sh", &p, (WRDE_NOCMD|WRDE_UNDEF));
   printf("exit code = %d\n", r);
   printf("Number of words = %d\n", p.we_wordc);

   w = p.we_wordv;

   for (i = 0; i < p.we_wordc; i++)
    printf("%s\n", w[i]);

   wordfree(&p);

   r = wordexp("/home/bas/'dir with spaces'/file.sh", &p, (WRDE_NOCMD|WRDE_UNDEF));
   printf("exit code = %d\n", r);
   printf("Number of words = %d\n", p.we_wordc);

   w = p.we_wordv;

   for (i = 0; i < p.we_wordc; i++)
    printf("%s\n", w[i]);

   wordfree(&p);

   exit(EXIT_SUCCESS);

}}}
-- 
********************************************************************
*  Bas van der Vlies                    e-mail: basv at sara.nl       *
*  SARA - Academic Computing Services   Amsterdam, The Netherlands *
********************************************************************

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3264 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20121011/c29bb9a1/attachment.bin 


More information about the torqueusers mailing list