Processing overhead on shell copy vs URL read and write

Sivakatirswami katir at hindu.org
Sat Feb 9 20:05:01 EST 2002


Any others on the list:  care to comment on this issue? copy and renaming
file using URL commands to read and write vs issuing a shell("cp
/someDir/foo.gif /otherDir/bar.gif")

 
> I think what you need is the real, absolute path name ... not the relative
> pathnames as seen by web browsers, where public_html appears to be root (/).
> 
> Take a look at what we put in as the full path name to the MC interpreter
> and that should give it to you.  Send that #!/..

I couldn't get the path thing working in shell, and rather than waste more
time "fishing" with path variations I ended up using xTalk after all which
only took 2 minutes...slightly more code, (two lines vs 1) 98% less
headache...(only because of the path mysteries)...oops... I am wrong...
actually it would be 1 more line to set up and issue the shell command.

Suspect: in terms of what is actually happening on the CPU, isn't it,
really, the same thing?..isn't the shell command also just reading data to
stnin and writing to stnout on cp however you cut it? so, in terms of
processing overhead, is there any difference?? anyway, this is a
wrap...though I still would like to get the path thing clear for shell

#!/cgi-bin/mc 
 on startup
   set the directory to "../images/"
   put random(15) into AumNo
   put "taka_aum_" &AumNo&".gif" into nextAum
   put URL ("binfile:aums/"&nextAum) into  temp_image
   put temp_image into URL ("binfile:taka_header_aum.gif")

#   put "cp /usr/public_html/images/aums/" & nextAum&\
#  " /usr/public_html/images/taka_header_aum.gif" into command_string
#   set the shellCommand to "/usr/bin/bash"
#   put shell(command_string)


end startUp


Om shanti,
Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
katir at hindu.org 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org





More information about the metacard mailing list