Trying to ZIP directory

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Trying to ZIP directory

Francesco Badaloni
Hi All,

I'm trying to zip a directory with Lasso 8.5.6, here my code.

[var: 'dir' = '1']
[Variable: 'File_Root' = '///Library/WebServer/path_to/']
[Variable: 'File_dir' = $File_Root + $dir+'/']
[Inline: -Username='USER', -Password='PASSWORD']
[Var: 'os' = (OS_Process: '/usr/bin/zip', (Array: '$File_Dir', '$File_Root'))]
[$os->Write]
[$os->Close]
[/inline]

but nothing happens.

What is wrong?

Thanks in advance

francesco

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to ZIP directory

stevepiercy
Did you check the Lasso Language Guide for installation and configuration?

os_process has many of the same issues as setting up file
permissions.  Try some of the troubleshooting techniques in my
article under Code Samples.
http://www.stevepiercy.com/articles/setting-up-file-tag-permissions-in-lasso-professional-8-on-mac-os-x-and-linux/#code-samples

--steve


On 11/18/16 at 1:05 PM, [hidden email] (Francesco
Badaloni) pronounced:

>Hi All,
>
>I'm trying to zip a directory with Lasso 8.5.6, here my code.
>
>[var: 'dir' = '1']
>[Variable: 'File_Root' = '///Library/WebServer/path_to/']
>[Variable: 'File_dir' = $File_Root + $dir+'/']
>[Inline: -Username='USER', -Password='PASSWORD']
>[Var: 'os' = (OS_Process: '/usr/bin/zip', (Array: '$File_Dir', '$File_Root'))]
>[$os->Write]
>[$os->Close]
>[/inline]
>
>but nothing happens.
>
>What is wrong?
>
>Thanks in advance
>
>francesco
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Soquel, CA
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to ZIP directory

Marc Vos-3
In reply to this post by Francesco Badaloni
I think that  (Array: '$File_Dir', '$File_Root')  should be  (Array: $File_Dir, $File_Root)
(no quotes around variable names)

- -
Marc
 

> On 18 nov. 2016, at 13:05, Francesco Badaloni <[hidden email]> wrote:
>
> Hi All,
>
> I'm trying to zip a directory with Lasso 8.5.6, here my code.
>
> [var: 'dir' = '1']
> [Variable: 'File_Root' = '///Library/WebServer/path_to/']
> [Variable: 'File_dir' = $File_Root + $dir+'/']
> [Inline: -Username='USER', -Password='PASSWORD']
> [Var: 'os' = (OS_Process: '/usr/bin/zip', (Array: '$File_Dir', '$File_Root'))]
> [$os->Write]
> [$os->Close]
> [/inline]
>
> but nothing happens.
>
> What is wrong?
>
> Thanks in advance
>
> francesco
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to ZIP directory

Peter D Bethke
In reply to this post by Francesco Badaloni
Hi Francesco,

I know I’m sending you a bit sideways, but if you are still running 8.5.6, you might consider using Steffan Cline’s passthru library - its much easier to use than the built-in lasso os_process imho.

I think Steffan still might be around.

Peter

> On Nov 18, 2016, at 7:05 AM, Francesco Badaloni <[hidden email]> wrote:
>
> Hi All,
>
> I'm trying to zip a directory with Lasso 8.5.6, here my code.
>
> [var: 'dir' = '1']
> [Variable: 'File_Root' = '///Library/WebServer/path_to/']
> [Variable: 'File_dir' = $File_Root + $dir+'/']
> [Inline: -Username='USER', -Password='PASSWORD']
> [Var: 'os' = (OS_Process: '/usr/bin/zip', (Array: '$File_Dir', '$File_Root'))]
> [$os->Write]
> [$os->Close]
> [/inline]
>
> but nothing happens.
>
> What is wrong?
>
> Thanks in advance
>
> francesco
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to ZIP directory

Adam Richardson
Hi Peter,

Francesco you may also want to have look at Jason Huck's [shell] tag for LP8 ...

http://www.lassosoft.com/tagswap/detail/shell

----
"This is a simple wrapper for the [os_process] type that allows you to interact with a bash shell, similar to how you would if you were using Terminal on OS X. On Windows, it interacts with the cmd process. The tag creates a new [os_process] type, opens a new shell, switches the current working directory to the folder from which the tag was called, and executes whatever command is passed to it. Requires [response_localfolder] and only loads if the [os_process] type is loaded."
----

The thing I like about using [shell] is that you can check a terminal command is working in the terminal, then just paste that terminal command straight into the [shell] tag in your code without needing to reformat the terminal command for the format that the os_process tag uses.

eg ...

shell('echo foo');

If you look at the source of the [shell] tag, you will see that it calls Jason's [response_localfolder] tag, and the part of [shell] that does the work on OS's other than Windows is ...

----
local('shell') = os_process(
                                '/bin/bash',
                                (: '-c', 'cd ' + response_localfolder + '; ' + #cmd)
                        );
----

... so it is using os_process to create a bash shell, changes the directory to the directory found by [response_localfolder], then executes the terminal command which has been passed to the [shell] tag.

To run the [shell] tag you also need the [response_localfolder] tag for LP8 which is here ...

http://www.lassosoft.com/tagswap/detail/response_localfolder

- Adam


> On 21 Nov 2016, at 5:22 AM, Peter D Bethke <[hidden email]> wrote:
>
> Hi Francesco,
>
> I know I’m sending you a bit sideways, but if you are still running 8.5.6, you might consider using Steffan Cline’s passthru library - its much easier to use than the built-in lasso os_process imho.
>
> I think Steffan still might be around.
>
> Peter
>
>> On Nov 18, 2016, at 7:05 AM, Francesco Badaloni <[hidden email]> wrote:
>>
>> Hi All,
>>
>> I'm trying to zip a directory with Lasso 8.5.6, here my code.
>>
>> [var: 'dir' = '1']
>> [Variable: 'File_Root' = '///Library/WebServer/path_to/']
>> [Variable: 'File_dir' = $File_Root + $dir+'/']
>> [Inline: -Username='USER', -Password='PASSWORD']
>> [Var: 'os' = (OS_Process: '/usr/bin/zip', (Array: '$File_Dir', '$File_Root'))]
>> [$os->Write]
>> [$os->Close]
>> [/inline]
>>
>> but nothing happens.
>>
>> What is wrong?
>>
>> Thanks in advance
>>
>> francesco
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to ZIP directory

Francesco Badaloni
Hi All and thanks for your reply,

after some time I got back to my problem trying to zip a dir.

Thanks Steve for your article, I read in the past, I checked all permission settings and
tried this code:

[var: 'dir' = '1']
[Variable: 'File_Root' = '///Library/WebServer/Sites/path-to/']
[Variable: 'File_dir' = $File_Root + $dir+'/']

[Inline: -Username='user', -Password='pass']
[Var: 'os' = (OS_Process: '/bin/ls', (Array: $File_Dir))]
[Encode_HTML: $os->Read]
[$os->Close]
[/Inline]

and it works and lists the dir correctly; thus I assume that the os_process permissions are right.

But when I run the following code, nothing happens.

[Inline: -Username='user', -Password='pass', -Nothing]
[Var: 'os' = (OS_Process: '/usr/bin/zip -r name_file.zip', (Array: $File_Dir))]
[$os->Write]
[$os->Close]
[/inline]

I have tried all ways but without success.

Thanks Adam for your suggestion, I studied the [shell] tag but I am still
a bit confused about the right syntax for my case.

If you have any other suggestions I will be really glad to here from you.

Merry Christmas and a Happy new Year to you all.

francesco


Il giorno 22/nov/2016, alle ore 11:10, Adam Richardson ha scritto:

> Hi Peter,
>
> Francesco you may also want to have look at Jason Huck's [shell] tag for LP8 ...
>
> http://www.lassosoft.com/tagswap/detail/shell
>
> ----
> "This is a simple wrapper for the [os_process] type that allows you to interact with a bash shell, similar to how you would if you were using Terminal on OS X. On Windows, it interacts with the cmd process. The tag creates a new [os_process] type, opens a new shell, switches the current working directory to the folder from which the tag was called, and executes whatever command is passed to it. Requires [response_localfolder] and only loads if the [os_process] type is loaded."
> ----
>
> The thing I like about using [shell] is that you can check a terminal command is working in the terminal, then just paste that terminal command straight into the [shell] tag in your code without needing to reformat the terminal command for the format that the os_process tag uses.
>
> eg ...
>
> shell('echo foo');
>
> If you look at the source of the [shell] tag, you will see that it calls Jason's [response_localfolder] tag, and the part of [shell] that does the work on OS's other than Windows is ...
>
> ----
> local('shell') = os_process(
> '/bin/bash',
> (: '-c', 'cd ' + response_localfolder + '; ' + #cmd)
> );
> ----
>
> ... so it is using os_process to create a bash shell, changes the directory to the directory found by [response_localfolder], then executes the terminal command which has been passed to the [shell] tag.
>
> To run the [shell] tag you also need the [response_localfolder] tag for LP8 which is here ...
>
> http://www.lassosoft.com/tagswap/detail/response_localfolder
>
> - Adam
>
>
>> On 21 Nov 2016, at 5:22 AM, Peter D Bethke <[hidden email]> wrote:
>>
>> Hi Francesco,
>>
>> I know I’m sending you a bit sideways, but if you are still running 8.5.6, you might consider using Steffan Cline’s passthru library - its much easier to use than the built-in lasso os_process imho.
>>
>> I think Steffan still might be around.
>>
>> Peter
>>
>>> On Nov 18, 2016, at 7:05 AM, Francesco Badaloni <[hidden email]> wrote:
>>>
>>> Hi All,
>>>
>>> I'm trying to zip a directory with Lasso 8.5.6, here my code.
>>>
>>> [var: 'dir' = '1']
>>> [Variable: 'File_Root' = '///Library/WebServer/path_to/']
>>> [Variable: 'File_dir' = $File_Root + $dir+'/']
>>> [Inline: -Username='USER', -Password='PASSWORD']
>>> [Var: 'os' = (OS_Process: '/usr/bin/zip', (Array: '$File_Dir', '$File_Root'))]
>>> [$os->Write]
>>> [$os->Close]
>>> [/inline]
>>>
>>> but nothing happens.
>>>
>>> What is wrong?
>>>
>>> Thanks in advance
>>>
>>> francesco
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Trying to ZIP directory

Anibal Escobar
Hi Francesco, we do the following to create zip files:

var('os' = OS_Process('/bin/bash', array('-c', '/path_to_zip_script ' +
$parameter1 + ' ' + $parameter2 + ' ' + $parameter3)));

the zip script is a bash script that actually does the zipping. Hope it
helps.

On 12/19/16 3:10 PM, Francesco Badaloni wrote:

> Hi All and thanks for your reply,
>
> after some time I got back to my problem trying to zip a dir.
>
> Thanks Steve for your article, I read in the past, I checked all permission settings and
> tried this code:
>
> [var: 'dir' = '1']
> [Variable: 'File_Root' = '///Library/WebServer/Sites/path-to/']
> [Variable: 'File_dir' = $File_Root + $dir+'/']
>
> [Inline: -Username='user', -Password='pass']
> [Var: 'os' = (OS_Process: '/bin/ls', (Array: $File_Dir))]
> [Encode_HTML: $os->Read]
> [$os->Close]
> [/Inline]
>
> and it works and lists the dir correctly; thus I assume that the os_process permissions are right.
>
> But when I run the following code, nothing happens.
>
> [Inline: -Username='user', -Password='pass', -Nothing]
> [Var: 'os' = (OS_Process: '/usr/bin/zip -r name_file.zip', (Array: $File_Dir))]
> [$os->Write]
> [$os->Close]
> [/inline]
>
> I have tried all ways but without success.
>
> Thanks Adam for your suggestion, I studied the [shell] tag but I am still
> a bit confused about the right syntax for my case.
>
> If you have any other suggestions I will be really glad to here from you.
>
> Merry Christmas and a Happy new Year to you all.
>
> francesco
>
>
> Il giorno 22/nov/2016, alle ore 11:10, Adam Richardson ha scritto:
>
>> Hi Peter,
>>
>> Francesco you may also want to have look at Jason Huck's [shell] tag for LP8 ...
>>
>> http://www.lassosoft.com/tagswap/detail/shell
>>
>> ----
>> "This is a simple wrapper for the [os_process] type that allows you to interact with a bash shell, similar to how you would if you were using Terminal on OS X. On Windows, it interacts with the cmd process. The tag creates a new [os_process] type, opens a new shell, switches the current working directory to the folder from which the tag was called, and executes whatever command is passed to it. Requires [response_localfolder] and only loads if the [os_process] type is loaded."
>> ----
>>
>> The thing I like about using [shell] is that you can check a terminal command is working in the terminal, then just paste that terminal command straight into the [shell] tag in your code without needing to reformat the terminal command for the format that the os_process tag uses.
>>
>> eg ...
>>
>> shell('echo foo');
>>
>> If you look at the source of the [shell] tag, you will see that it calls Jason's [response_localfolder] tag, and the part of [shell] that does the work on OS's other than Windows is ...
>>
>> ----
>> local('shell') = os_process(
>> '/bin/bash',
>> (: '-c', 'cd ' + response_localfolder + '; ' + #cmd)
>> );
>> ----
>>
>> ... so it is using os_process to create a bash shell, changes the directory to the directory found by [response_localfolder], then executes the terminal command which has been passed to the [shell] tag.
>>
>> To run the [shell] tag you also need the [response_localfolder] tag for LP8 which is here ...
>>
>> http://www.lassosoft.com/tagswap/detail/response_localfolder
>>
>> - Adam
>>
>>
>>> On 21 Nov 2016, at 5:22 AM, Peter D Bethke <[hidden email]> wrote:
>>>
>>> Hi Francesco,
>>>
>>> I know I’m sending you a bit sideways, but if you are still running 8.5.6, you might consider using Steffan Cline’s passthru library - its much easier to use than the built-in lasso os_process imho.
>>>
>>> I think Steffan still might be around.
>>>
>>> Peter
>>>
>>>> On Nov 18, 2016, at 7:05 AM, Francesco Badaloni <[hidden email]> wrote:
>>>>
>>>> Hi All,
>>>>
>>>> I'm trying to zip a directory with Lasso 8.5.6, here my code.
>>>>
>>>> [var: 'dir' = '1']
>>>> [Variable: 'File_Root' = '///Library/WebServer/path_to/']
>>>> [Variable: 'File_dir' = $File_Root + $dir+'/']
>>>> [Inline: -Username='USER', -Password='PASSWORD']
>>>> [Var: 'os' = (OS_Process: '/usr/bin/zip', (Array: '$File_Dir', '$File_Root'))]
>>>> [$os->Write]
>>>> [$os->Close]
>>>> [/inline]
>>>>
>>>> but nothing happens.
>>>>
>>>> What is wrong?
>>>>
>>>> Thanks in advance
>>>>
>>>> francesco
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>    the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

--
Anibal Escobar
styleexpo
601 W. 26th St., Ste. M254
New York, NY  10001
646-502-8821


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Loading...