File_GetSize and File_ModDate in L9.3

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

File_GetSize and File_ModDate in L9.3

Marc Vos-3
Hello,

I noticed that File_GetSize and File_ModDate in L9.3 do not return anything.
The same code in L8 returns the data as expected.

Is there a L9.3 replacement for these tags?

- -
Thanks,
Marc



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

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
|

Re: File_GetSize and File_ModDate in L9.3

Jolle Carlestam-2
7 mar 2016 kl. 14:02 skrev Marc Vos <[hidden email]>:
>
> I noticed that File_GetSize and File_ModDate in L9.3 do not return anything.
> The same code in L8 returns the data as expected.
>
> Is there a L9.3 replacement for these tags?

This works for me:
File_GetSize('///var/lasso/lasso.out.txt’)
’<br>’
File_ModDate('///var/lasso/lasso.out.txt’)
->
127829
2016-03-03 13:07:33

Check your paths. Might be that you need path from full root.


HDB
Jolle





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

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
|

Re: File_GetSize and File_ModDate in L9.3

Marc Vos-3
Ok, I tested and if I do the full path with '///' it works.

But in L8 I use 'files/projects/1/testfile.txt', where 'files' is a folder within the same folder the index.lasso is in. Read/Write permissions are in order.

Porting to L9, 'file_listedirectory' returns the array with files allright, but the other two return nothing.

The lasso page doesn't know the full path to the file.

- -
Marc




On 07-03-2016 14:12, "Jolle Carlestam" <[hidden email] on behalf of [hidden email]> wrote:

>7 mar 2016 kl. 14:02 skrev Marc Vos <[hidden email]>:
>>
>> I noticed that File_GetSize and File_ModDate in L9.3 do not return anything.
>> The same code in L8 returns the data as expected.
>>
>> Is there a L9.3 replacement for these tags?
>
>This works for me:
>File_GetSize('///var/lasso/lasso.out.txt’)
>’<br>’
>File_ModDate('///var/lasso/lasso.out.txt’)
>->
>127829
>2016-03-03 13:07:33
>
>Check your paths. Might be that you need path from full root.
>
>
>HDB
>Jolle
>
>
>
>
>
>#############################################################
>
>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
|

Re: File_GetSize and File_ModDate in L9.3

Marc Vos-3
So I found 'Response_LocalPath' and used that to create a var with the full path in it.
Now it works.

Thanks for the hint!

- -
Regards,
Marc




On 07-03-2016 14:31, "Marc Vos" <[hidden email] on behalf of [hidden email]> wrote:

>Ok, I tested and if I do the full path with '///' it works.
>
>But in L8 I use 'files/projects/1/testfile.txt', where 'files' is a folder within the same folder the index.lasso is in. Read/Write permissions are in order.
>
>Porting to L9, 'file_listedirectory' returns the array with files allright, but the other two return nothing.
>
>The lasso page doesn't know the full path to the file.
>
>- -
>Marc
>
>
>
>
>On 07-03-2016 14:12, "Jolle Carlestam" <[hidden email] on behalf of [hidden email]> wrote:
>
>>7 mar 2016 kl. 14:02 skrev Marc Vos <[hidden email]>:
>>>
>>> I noticed that File_GetSize and File_ModDate in L9.3 do not return anything.
>>> The same code in L8 returns the data as expected.
>>>
>>> Is there a L9.3 replacement for these tags?
>>
>>This works for me:
>>File_GetSize('///var/lasso/lasso.out.txt’)
>>’<br>’
>>File_ModDate('///var/lasso/lasso.out.txt’)
>>->
>>127829
>>2016-03-03 13:07:33
>>
>>Check your paths. Might be that you need path from full root.
>>
>>
>>HDB
>>Jolle
>>
>>
>>
>>
>>
>>#############################################################
>>
>>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
|

Re: File_GetSize and File_ModDate in L9.3

Jolle Carlestam-2
7 mar 2016 kl. 14:49 skrev Marc Vos <[hidden email]>:
>
> So I found 'Response_LocalPath' and used that to create a var with the full path in it.
> Now it works.
>
> Thanks for the hint!

You can use that. Or you can use file_forceRoot

file_forceRoot(’myttest.lasso')
’<br>'
file_forceRoot('/dev/myttest.lasso’)
’<br>'
local(fullpath = file_forceRoot('/dev/myttest.lasso'))
File_ModDate(#fullpath)


->
//Library/WebServer/Documents//dev/myttest.lasso
//Library/WebServer/Documents//dev/myttest.lasso
2016-03-07 15:05:22

HDB
Jolle

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

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
|

Re: File_GetSize and File_ModDate in L9.3

Marc Vos-3
Didn’t know that one!

Strange that when searching with the word 'path', this tag does not show up...

- -
Marc







On 07-03-2016 15:08, "Jolle Carlestam" <[hidden email] on behalf of [hidden email]> wrote:

>7 mar 2016 kl. 14:49 skrev Marc Vos <[hidden email]>:
>>
>> So I found 'Response_LocalPath' and used that to create a var with the full path in it.
>> Now it works.
>>
>> Thanks for the hint!
>
>You can use that. Or you can use file_forceRoot
>
>file_forceRoot(’myttest.lasso')
>’<br>'
>file_forceRoot('/dev/myttest.lasso’)
>’<br>'
>local(fullpath = file_forceRoot('/dev/myttest.lasso'))
>File_ModDate(#fullpath)
>
>
>->
>//Library/WebServer/Documents//dev/myttest.lasso
>//Library/WebServer/Documents//dev/myttest.lasso
>2016-03-07 15:05:22
>
>HDB
>Jolle
>
>#############################################################
>
>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
|

Re: File_GetSize and File_ModDate in L9.3

Jolle Carlestam-2
7 mar 2016 kl. 15:25 skrev Marc Vos <[hidden email]>:
>
> Didn’t know that one!
>
> Strange that when searching with the word 'path', this tag does not show up...

Well, the word ”path” is not part of the word ”file_forceRoot”. But I do find it a bit funny that when searching for file_forceRoot at http://lassoguide.com there’re no matches. :-)

You can however find it at good old Lassodocs:
http://www.lassosoft.com/lassoDocs/languageReference/obj/file_forceRoot


Oh, and another thing. File_GetSize and File_ModDate are compatibly methods that you can tweak to get the desired Lasso 8 style behavior. Do that and you don’t need to find and change all occurrences of the method calls in your present code base.

define File_GetSize(path::string) => io_file_stat_size(file_forceRoot(#path))
define File_ModDate(path::string) => date(io_file_stat_mtime(file_forceRoot(#path)))

If you’re up to it, file a bug report and give Lassosoft the desired modified code. You can claim you came up with the solution. :-)


HDB
Jolle

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

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
|

Re: File_GetSize and File_ModDate in L9.3

Jolle Carlestam-2
7 mar 2016 kl. 17:01 skrev Jolle Carlestam <[hidden email]>:
>
> define File_GetSize(path::string) => io_file_stat_size(file_forceRoot(#path))

Let me expand a bit on this.

Here’s the original definition:
define File_GetSize(path::string) => io_file_stat_size(#path)

Io_file_stat_size assumes the path is defined from server root.

My tweak for File_GetSize will make sure the path provided is converted to server root before calling the actual method.
define File_GetSize(path::string) => io_file_stat_size(file_forceRoot(#path))

Thus this will all work:

File_GetSize(’mytest.lasso’)
Path relative to the calling Lasso file.

File_GetSize('/dev/mytest.lasso’)
Path from root of site.

File_GetSize('//Library/WebServer/Documents//dev/mytest.lasso’)
Path from root of server.
The only one that works with original definition of File_GetSize

Have fun!

HDB
Jolle

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

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
|

Re: File_GetSize and File_ModDate in L9.3

Marc Vos-3
In reply to this post by Jolle Carlestam-2
Thanks Jolle!
But I know someone of LS reads this list too, so hopefully LS will accept your suggestion.

- -
Marc





On 07-03-2016 17:01, "Jolle Carlestam" <[hidden email] on behalf of [hidden email]> wrote:

>7 mar 2016 kl. 15:25 skrev Marc Vos <[hidden email]>:
>>
>> Didn’t know that one!
>>
>> Strange that when searching with the word 'path', this tag does not show up...
>
>Well, the word ”path” is not part of the word ”file_forceRoot”. But I do find it a bit funny that when searching for file_forceRoot at http://lassoguide.com there’re no matches. :-)
>
>You can however find it at good old Lassodocs:
>http://www.lassosoft.com/lassoDocs/languageReference/obj/file_forceRoot
>
>
>Oh, and another thing. File_GetSize and File_ModDate are compatibly methods that you can tweak to get the desired Lasso 8 style behavior. Do that and you don’t need to find and change all occurrences of the method calls in your present code base.
>
>define File_GetSize(path::string) => io_file_stat_size(file_forceRoot(#path))
>define File_ModDate(path::string) => date(io_file_stat_mtime(file_forceRoot(#path)))
>
>If you’re up to it, file a bug report and give Lassosoft the desired modified code. You can claim you came up with the solution. :-)
>
>
>HDB
>Jolle
>
>#############################################################
>
>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
|

Re: File_GetSize and File_ModDate in L9.3

Jolle Carlestam-2
7 mar 2016 kl. 17:21 skrev Marc Vos <[hidden email]>:
>
> Thanks Jolle!

No worries!

> But I know someone of LS reads this list too, so hopefully LS will accept your suggestion.

Can not be counted on. If you want the tweak to make it into regular Lasso 9 code best bet is to make a ticket of it in Rhinotracs. This is my many years of experience talking here.
In this case I don’t care. Don’t use neither method. But if you do, follow my recommendation.




Wait!
"Don’t use neither method.”
Then what do I use?
Well, I tend to create a file object and work with that.

local(myfile = file('/dev/mytest.lasso'))
#myfile -> size
#myfile -> modificationDate

HDB
Jolle

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

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]>