Linux Help
Linux Help
It would be nice if any Linux Gurus pass through
and post a tip or two here..
..I'm not a Guru, but I've found a couple of things
with trying to use PureBASIC under Linux.
you have to manually set permissions before
you can execute a binary you've created.
(any Guru with a script that will compile, chmod, etc?)
you can "run" code directly by: pbcompiler filename.pb
you can "run" your compiled binary using: ./filename.bin
Joe
and post a tip or two here..
..I'm not a Guru, but I've found a couple of things
with trying to use PureBASIC under Linux.
you have to manually set permissions before
you can execute a binary you've created.
(any Guru with a script that will compile, chmod, etc?)
you can "run" code directly by: pbcompiler filename.pb
you can "run" your compiled binary using: ./filename.bin
Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
Well bizzarely you could just write your own little....
Why not code a simple PB console app for linux that does what you want...
Just shell out the commands to CHMOD 766 xxxx.exe, rename the executable to a linux std, i.e. no extension. Even move it to a debug/test directory. Shouldnt be that hard?
Regards
Andy
Just shell out the commands to CHMOD 766 xxxx.exe, rename the executable to a linux std, i.e. no extension. Even move it to a debug/test directory. Shouldnt be that hard?
Regards
Andy
Re: Well bizzarely you could just write your own little....
duh never thought of that.Iria wrote:Why not code a simple PB console app for linux that does what you want...
thanks for the chmod value.. ..that I didn't know what to set as.
Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
this may help you....
Chmod is a little more involved but for simple high level permission setting I found this little site...
http://javascriptkit.com/script/script2/chmodcal.shtml
which simply lets you work out in a nice human readable form what permission values to use to get different results.
hope that helps ...
http://javascriptkit.com/script/script2/chmodcal.shtml
which simply lets you work out in a nice human readable form what permission values to use to get different results.
hope that helps ...
thanks for the chmod calculator link!
I can't get runprogram to do it though... :roll:
--jb
I can't get runprogram to do it though...
Code: Select all
;RunProgram(FileName$ [, Parameter$, WorkingDirectory$ [, Flags]])
FileName$ = "chmod" : Parameter$ = "744 testfile" : WorkingDirectory$ = ""
RunProgram(FileName$ , Parameter$, WorkingDirectory$)
;RunProgram("chmod","744 testfile","") :;chmod complains "too few arguments"
;RunProgram("chmod"," 744 testfile","") :;chmod complains "too few arguments"
;RunProgram("chmod","744","./testfile") :;chmod complains "too few arguments"
;RunProgram("chmod","744 testfile","") :;chmod complains "too few arguments"
;RunProgram("chmod","744 testfile","./") :;chmod complains "too few arguments"
;RunProgram("chmod","-c 744 testfile","") :;chmod complains "invalid option"
;RunProgram("chmod","-c744 testfile","") :;chmod complains "too few arguments"
;RunProgram("chmod","--help","") :;this works!
End
--jb
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
O.K.
root can't do it either, but that doesn't seem to be the problem.
it seems to be the passing of parameters in general, not just to chmod.
I've also discovered something weird about the Linux I am using:
from the terminal window the permissions show
a binary created by PureBASIC as executable, and it IS!
BUT using the Nautilus "Graphic Shell" (file browser) the same
file's permissions show NOT executable.
It's as if the O.S. is keeping two separate permissions lists.
One for the terminal mode and one for the GUI mode.!?
None of that explains why I can't properly pass parameters.
Can anyone give an example of code successfully passing
parameters from one Linux executable to another?
Joe
root can't do it either, but that doesn't seem to be the problem.
it seems to be the passing of parameters in general, not just to chmod.
I've also discovered something weird about the Linux I am using:
from the terminal window the permissions show
a binary created by PureBASIC as executable, and it IS!
BUT using the Nautilus "Graphic Shell" (file browser) the same
file's permissions show NOT executable.
It's as if the O.S. is keeping two separate permissions lists.
One for the terminal mode and one for the GUI mode.!?
None of that explains why I can't properly pass parameters.
Can anyone give an example of code successfully passing
parameters from one Linux executable to another?
Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
Re: Linux Help RunProgram("chmod", "777 /tmp/test.sh", ""
Works as expected using PB 572 x64 on Ubuntu 18.04 x64
Code: Select all
If CreateFile(0, "/tmp/test.sh")
WriteStringN(0, "#!/bin/bash")
WriteStringN(0, "ls -lA > /tmp/test.txt")
CloseFile(0)
Else
MessageRequester("Error", "Unable to create script")
EndIf
RunProgram("chmod", "777 /tmp/test.sh", "")
Delay(1000)
RunProgram("/tmp/test.sh")
End