Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [ANNOUNCE] Geany IDE - supports C,C++,python,java,php,ruby,etc...

    Reply
    Page 6 of 6 | Prev |   4     5   6 |
    dantonic | # 51 | 2009-09-02, 21:26 | Report

    Originally Posted by BruceL View Post
    Hi, I'm glad you got most of the way there!
    I think there are two things missing:
    First, make sure you have execute permissions on the executable file.

    chmod a+x test.o

    Next, run it like this:

    ./test.o

    I don't know why Geany isn't running it correctly, but perhaps the above will help. (I use the command line myself.)

    Good luck!
    Hi,thanks for the reply.
    I'm not well versed in linux, but anyway this is what i tried:
    /media/mmc1/docs/cisp 360 # chmod a+x test.o
    /media/mmc1/docs/cisp 360 # /test.o
    /bin/sh: /test.o: not found
    /media/mmc1/docs/cisp 360 # ls
    gcc-3.4.install test.c
    geany_run_script.sh test.o
    test
    /media/mmc1/docs/cisp 360 #

    Edit | Forward | Quote | Quick Reply | Thanks

     
    BruceL | # 52 | 2009-09-02, 21:33 | Report

    There is a '.' before the /test.o
    In linux, if you want to execute a file that isn't in the path you need to prefix it with './' (dot slash). It's a safety precaution I believe.

    Also, if ./test.o doesn't work, try it with the 'test' file; I'm not sure how Geany made things.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to BruceL For This Useful Post:
    Texrat

     
    dantonic | # 53 | 2009-09-09, 18:57 | Report

    Originally Posted by BruceL View Post
    There is a '.' before the /test.o
    In linux, if you want to execute a file that isn't in the path you need to prefix it with './' (dot slash). It's a safety precaution I believe.

    Also, if ./test.o doesn't work, try it with the 'test' file; I'm not sure how Geany made things.
    I've tried every combination, ./test.o ./test test test.o

    I always get the error: /bin/sh: ./test(.o) permission denied

    any ideas about what could be going on?

    I've also tried this as root. Not sure why it wont let me run it.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    BruceL | # 54 | 2009-09-09, 19:11 | Report

    the command

    chmod a+x test(.o)

    should give you permission.

    Type "ls -l" (no quotes) in that folder to see if you have executable permissions. The file should look something like this:

    -rw-rw-r-x 1 ebrulon cbssw 25 Apr 15 11:08 test.o

    the 'x' in the '-rw-rw-r-x' means that you have executable permissions. It could also look something like '-rwxrwxrwx' the 'x's are executable permissions. (r and w are read and write.)

    Also, are there any files that end with '.out' in the folder? The executable could have that extension.

    Bruce

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to BruceL For This Useful Post:
    dantonic, Texrat

     
    dantonic | # 55 | 2009-09-09, 19:53 | Report

    Originally Posted by BruceL View Post
    the command

    chmod a+x test(.o)

    should give you permission.

    Type "ls -l" (no quotes) in that folder to see if you have executable permissions. The file should look something like this:

    -rw-rw-r-x 1 ebrulon cbssw 25 Apr 15 11:08 test.o

    the 'x' in the '-rw-rw-r-x' means that you have executable permissions. It could also look something like '-rwxrwxrwx' the 'x's are executable permissions. (r and w are read and write.)

    Also, are there any files that end with '.out' in the folder? The executable could have that extension.

    Bruce
    thanks for the response. Trying the chmod command and the ls -l to check for change in execution permissions. The permissions do not change, it stays at -rw-r--r-- for all files in that folder.

    tried it for test and test.o

    I appreciate your help, any other ideas? another way to change permissions? looks like that's the problem.
    no files ending with .out

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by dantonic; 2009-09-09 at 20:03.

     
    BruceL | # 56 | 2009-09-09, 20:07 | Report

    To change permissions you must own the file. When you do 'ls -l' does it say 'user' or 'root' as owner. In the above example 'ebrulon' is me (the owner) and 'cbssw' is the group I am in. Since it is best to build files as user, do this:

    1) make sure you are root
    2) cd to the parent of your project folder.
    3) chown -R user <name-of-your-project-folder>

    This should recursively CHange the OWNership of the folder and all its contents to user.

    THEN try chmod a-x again.

    The command chgrp does the same thing for the file's group.

    This does eventually get easier, BTW.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to BruceL For This Useful Post:
    dantonic, Texrat

     
    Jaffa | # 57 | 2009-09-09, 20:55 | Report

    If you can't change the permissions, is the file in /media/mmc*, which is mounted noexec

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Jaffa For This Useful Post:
    dantonic

     
    dantonic | # 58 | 2009-09-09, 21:48 | Report

    ok, so thanks to both of you for starters. I was saving to my mmc card. I tried to save to the mydocs folder of the OS, and I do have permissions in there, and am able to run it.

    Is it impossible to run such a file from a storage partition such as my mmc1 card?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Jaffa | # 59 | 2009-09-09, 21:55 | Report

    Originally Posted by dantonic View Post
    Is it impossible to run such a file from a storage partition such as my mmc1 card?
    No, it's Maemo - nothing's impossible[TM] ;-).

    You have three basic options:
    1. Don't use the MMC, use the root fs. Problem goes away.
    2. Run it using /lib/ld-linux.so.2 ./test. This bypasses the noexec flag.
    3. Modify /etc/fstab and remove noexec for /media/mmc1.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to Jaffa For This Useful Post:
    sjgadsby, Texrat

     
    Page 6 of 6 | Prev |   4     5   6 |
vBulletin® Version 3.8.8
Normal Logout