Page 2 of 2

Re: Len of path limit for FileSize() [Resolved]

Posted: Tue Jan 02, 2024 9:09 pm
by Kwai chang caine
Thanks a lot i'm impressed :shock:
Have a very good year 8)

Re: Len of path limit for FileSize() [Resolved]

Posted: Mon Jan 08, 2024 2:04 am
by boddhi
Hi KCC,
Kwai chang caine wrote: How do you know the combination of constants, when you have the value ?
A toutes fins utile, if needed,

A link to a tool (which can be used either on its own or as a custom PB tool) listing all the constants integrated into PB.

Image

This was an adaptation of code originally created by Gnozal. Fully fonctional under W10 x64. Not tested under others OS.
I can no longer find the original souce. :(

Re: Len of path limit for FileSize() [Resolved]

Posted: Mon Jan 08, 2024 3:04 am
by AZJIO
Kwai chang caine wrote: Tue Jan 02, 2024 8:42 pm How do you know the combination of constants, when you have the value ?
Find out which binary flags are in the number.

Code: Select all

Procedure GetFlgBin(flg_bin)
	Protected i, x ;, length
; 	length = Len(Bin(flg_bin))

    For i = 0 To 64 ; length
    	If flg_bin >> i & 1
;     		x = Pow(2, i)
    		x = 1 << i
    		If x
    			Debug x
    		EndIf
    	EndIf
    Next
EndProcedure

; GetFlgBin(9223372036854775807)
GetFlgBin(20)

Re: Len of path limit for FileSize() [Resolved]

Posted: Mon Jan 08, 2024 5:52 pm
by Kwai chang caine
Hello BODDHI
Thanks for this tool of the great GNOZAL who we miss :|
I have put it in the root folder of my 5.73 x86 and that works 8)
After ...it is not really sample to use for me, but it's can be usefull when even :wink:

Hello AZJIO
Thanks a lot for this hieroglyphal
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢰⣾⣝⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⢀⣽⠿⠙⢳⡝⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⣀⣿⣾⢃⣤⡄⠨⢦⡙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠏⠀⠀⠀⣜⣿⡟⣻⣿⡍⢀⠀⠉⡍⢠⡙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⣼⣿⣿⣟⣿⣿⣷⣿⣤⣄⡄⠀⠈⠢⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⡟⢿⣿⣿⣾⣧⡄⠤⠀⠀⠉⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⢀⣾⣿⣿⡟⣟⣌⣿⣇⣱⣶⣿⣿⣿⡿⠻⠀⠄⢀⠠⡄⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⡜⣠⡌⢀⣤⠀⠉⢈⡉⢩⣧⣼⣿⣿⡿⠂⠶⠀⠀⠑⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⣤⣥⣼⠾⠃⠮⠀⠉⠈⠿⣟⣻⢿⣿⢋⣄⠛⠗⢘⠃⠁⢂⠐⠈⠃⠀⠉⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠛⠛⡿⠿⠛⠻⠿⠿⠿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠀⢀⣼⡿⠿⠟⠦⠀⠀⢈⡀⢤⡿⠾⣟⣻⣶⣶⣶⣚⡀⠀⣤⣤⣛⡁⡌⠀⠀⠀⠀⠈⠻⠿⠟⠛⠿⠿⠿⠿⠿⠿⠿⣿⣿⣿⣿
⠾⠉⠁⠈⠉⠛⠿⠿⠟⠀⠀⠀⢀⡴⠆⠀⠀⠀⠀⡌⢧⠽⡶⠆⠁⢀⡒⠛⢳⣿⣷⢦⣭⢿⣿⣯⣷⣯⣳⣿⣿⣿⣭⣿⣉⣲⡀⠀⠦⠈⠷⠌⠓⢒⣛⠓⠛⢷⣷⠔⠂⠈⠹⠷⠀
⣤⣄⣀⣘⣓⣒⣂⣀⣀⣋⡁⠐⠋⢀⡀⠀⠀⠀⠞⢁⣐⠆⣁⣀⣭⣤⡤⣴⣿⣋⣉⣈⣉⣀⣀⡀⠀⢉⣀⡈⠉⣋⣁⣀⣠⣀⣤⣤⣄⣀⣀⣉⣀⣀⣁⣀⣤⣤⣤⡤⣤⠤⠶⣤⡀
⣿⡻⡿⠏⠛⣦⢯⣽⣭⣽⣿⣿⣿⣿⣿⣶⣶⣤⣦⣿⣿⣽⣿⣧⣦⣬⣥⣼⣿⣿⣿⣯⣯⣭⣟⣁⣐⣛⡛⠓⠉⣉⡛⠫⠿⢿⡶⠤⣶⠾⢿⣿⣿⣿⡛⠿⢿⡿⣿⠇⠀⢤⣤⢖⡃
⢿⣿⣿⣿⣿⣛⣻⣿⣿⣿⣿⣿⣿⡿⢿⣿⡋⡋⠸⡿⠛⠛⠿⣿⠙⠛⢛⣩⠉⠛⠻⠉⠉⢹⠖⠻⠿⢿⣻⠙⢛⣛⠋⣙⣻⣭⣥⣦⣤⣤⣦⣤⣄⣴⣬⣫⣀⣁⣀⢀⡊⠠⣮⣿⣿
⣸⣿⣿⣷⣿⣿⣿⣯⣭⣿⣿⣿⣍⡶⣶⣴⣾⠿⠛⣆⣀⢾⡓⠄⠰⢶⣤⣦⣝⣿⣶⣶⣿⣦⣀⢽⡆⠘⠭⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠋⠒⠛⠛⠛⠛⠓⠛⠛⠛⠛⠒⠚⠛⠛⠛⠛⠛⠛⠛⠛⠋⠙⠓⠛⠛⠛⠛⠛⠛⠛⠛⠓⠛⠛⠛⠛⠚⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛
source :shock:

But why there return always two time the result :wink:
compiler wrote:4
16
4
16
⠀⠀⠀⠀⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Re: Len of path limit for FileSize() [Resolved]

Posted: Tue Jan 09, 2024 3:23 am
by AZJIO
Kwai chang caine wrote: Mon Jan 08, 2024 5:52 pm But why there return always two time the result ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Code: Select all

Procedure GetFlgBin(flg_bin)
	Protected i
	CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
		#BinLength = 31
	CompilerElse
		#BinLength = 63
	CompilerEndIf
	For i = 0 To #BinLength
		If flg_bin >> i & 1
			Debug 1 << i
		EndIf
	Next
EndProcedure

GetFlgBin(21)
Or flg_bin.q

Code: Select all

Procedure GetFlgBin(flg_bin.q)
	Protected i
	For i = 0 To 63
		If flg_bin >> i & 1
			Debug 1 << i
		EndIf
	Next
EndProcedure

GetFlgBin(21)

Re: Len of path limit for FileSize() [Resolved]

Posted: Wed Jan 10, 2024 10:02 am
by Mesa
To be compatible with x86, we need another quad like that:

Code: Select all

Procedure GetFlgBin(flg_bin.q)
	Protected i, x.q
	For i = 0 To 63
		If flg_bin >> i & 1
			x = 1 << i
			Debug x
		EndIf
	Next
EndProcedure

GetFlgBin(21)
Debug "---"
GetFlgBin(9223372036854775807)

Debug Bin(9223372036854775807)
M.

Re: Len of path limit for FileSize() [Resolved]

Posted: Wed Jan 10, 2024 8:44 pm
by Kwai chang caine
Thank you very much AZJIO and MESA for your precious usefull codes that I will keep preciously 8)

Re: Len of path limit for FileSize() [Resolved]

Posted: Thu Jan 11, 2024 8:09 am
by Denis
Salut KCC,
Since the subject is interesting, can you create a module and share it? :mrgreen:

I get trouble with long Path and not only with PB. :(

Re: Len of path limit for FileSize() [Resolved]

Posted: Fri Jan 12, 2024 8:51 pm
by Kwai chang caine
Hello "Denaille" :mrgreen:
Happy to talk to you since this long time :wink:

I have not understand, you want a module of what ? :shock:

Re: Len of path limit for FileSize() [Resolved]

Posted: Fri Jan 12, 2024 10:41 pm
by Olli
Kwai chang caine wrote: Fri Jan 12, 2024 8:51 pm Hello "Denaille"
It is an english forum, I racole (recall) to you.

Also "denaille" is not an english word. I must so tell to everybody who are fed up to the french expressions, to the french vocabulary, to the french grammar, and, over everything, to the mistakes the frenches as I, make in every english sentence they try to write, I must so tell to them who are fed up to that, that "Denaille" is also a word who does not exist in french. It is a phonetic and familiar expression, you would have to write as this :

<< Hello Deny >>

Good new year to you too, Denis. Good new year to you Kcc, and good new year to everybody who share peacefully their logical knowledge.