SYSTEM vs USER

John Esak john at valar.com
Thu Aug 4 14:48:09 PDT 2005



> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com
> [mailto:filepro-list-bounces at lists.celestial.com]On Behalf Of Tyler
> Cameron Style
> Sent: Thursday, August 04, 2005 5:20 PM
> To: filepro-list at lists.celestial.com
> Subject: SYSTEM vs USER
>
>
>
> The documentation I have says the overhead for SYSTEM is pretty hefty,
> and to use USER instead.  Which is better for performing very basic OS
> functions, like kicking off a script or printing/chmod'ing a file?
>
> (EG) system "/usr/bin/moocow_test"
>
>      VS
>
>      user cow = /usr/bin/moocow_test
>      cow=""     'would this be necessary to have it execute, or is
>                 'just user good enough?
>
>
>
> Anyone have experience with comparing/contrasting these two puppies
> who would like to share?
>
> Thanks!
>
>      Tyler (tyler aT kinotox dOT com)
>
>
The SYSTEM and USER functions are in NO way similar. Whatever documentation
you read is flawed or misleading at best. SYSTEM is used to execute any
command that could be run from the command line of your operating system.
USER does not do this at all. It hands values to an operating system program
and returns values.

The uses of these two functions are completely different and not associated
at all.

I sympathize with you, though. The USER command is the single most poorly
documented command in all of filePro. If you just want to execute something
like a chmod, as you mentioned, do it with SYSTEM.

     system "chmod 600 /tmp/" { aa

where aa might hold some unique filename.  Or better yet,

  then: aa="chmod 600 /tmp/" { bb {";chown filepro /tmp/" { bb
  then: system aa

where bb would hold a filename... Of course, you can concatenate anything
into a variable and then execute that variable with SYSTEM... as long as the
final command makes sense to the operating system.

John Esak
The FP Room www.tinyurl.com/97y9u 24/7
The filePro Survivor full video traiing on filePro
www.valar.com/training



More information about the Filepro-list mailing list