Results 1 to 4 of 4

Thread: Permission problem running a compiled C++ program

  1. #1
    Junior Member
    Join Date
    Jul 2005
    Posts
    2

    Permission problem running a compiled C++ program

    I boot with Knoppix 3.7 and am still learning Linux. I need to clone a hard drive with lots of errors (dd can't handle it). I have obtained the source for GNU ddrescue (not to be confused with dd_rescue, written by Kurt Garloff), written in C++ by Antonio Diaz. http://www.gnu.org/software/ddrescue/ddrescue.html

    I had no problems unzipping and untarring the source files, and I was able to './configure' and then 'make' it (in the same directory on my USB flash drive where the source code is stored).

    But now I'm having trouble getting ddrescue to run. If I run it from 'Konsole' terminal with this invocation

    ddrescue /dev/hdc /dev/hdb testlog

    I get the following error: "ddrescue: cannot open input file: permission denied". I think this is because accessing a full drive like hdb or hdc (rather than a partition like hdb1 or hdc2) can only be done from Root.

    But when I launch a 'Terminal as Root' window (logging in as root with a password that I set myself) and navigate (cd) to the correct folder with the compiled folder, I am unable to invoke ddrescue...

    root@ttyp1[ddrescue-1.0]# ddrescue /dev/hdc /dev/hdb testlog
    bash: ddrescue: command not found

    What am I doing wrong? Is there another shell that I should be using?

  2. #2
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    100
    Root probably (and wisely!) does not have the current directory (.) in her PATH. Try ./ddrescue (that's dot-slash)

  3. #3
    Junior Member
    Join Date
    Jul 2005
    Posts
    2

    ./ worked

    THANKS!! Using ./ddrescue worked just fine, although I don't really understand why...

    I thought that the . (dot) specifies current directory, so ./ddrescue is telling the system to run ddrescue from a subdirectory of the current directory that I'm in?

  4. #4
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    100
    Yes, "." does mean the current directory. When you use a command that is not in a directory mentioned in PATH
    (type "echo $PATH" to see what's in there), then everything you type up to the last "/" is the path to the executable,
    the rest is the name of the executable itself. Try playing with the commands "basename" and "dirname".

    HTH

Similar Threads

  1. Running a program
    By Rehtwol in forum General Support
    Replies: 1
    Last Post: 09-22-2006, 04:43 AM
  2. Need a pre-compiled FTP program or "make install"
    By k00ld00d in forum General Support
    Replies: 2
    Last Post: 05-19-2006, 02:14 AM
  3. Running compiled files
    By kepler in forum General Support
    Replies: 2
    Last Post: 11-08-2004, 01:30 PM
  4. Running the program
    By oahuyahoo in forum General Support
    Replies: 4
    Last Post: 11-07-2004, 12:22 PM
  5. Program use and permission problems on hd install
    By chook in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 03-23-2004, 06:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Dell R640 8x 2.5

Dell R640 8x 2.5" SFF iDRAC 2x 25GbE SFP28- Wholesale Custom Build Your Server

$252.99



Dell PowerEdge R630 Server 2x E5-2697v3 2.60Ghz 28-Core 128GB H730P Rails picture

Dell PowerEdge R630 Server 2x E5-2697v3 2.60Ghz 28-Core 128GB H730P Rails

$295.00



Dell PowerEdge R640 8x2.5

Dell PowerEdge R640 8x2.5" Server 2*Xeon Gold 5118 192GB H740P idrac

$408.00



DELL PowerEdge R730 8SFF Server 2x E5-2690v4 =28 Cores No RAM/ HDD H730 4xRJ45 picture

DELL PowerEdge R730 8SFF Server 2x E5-2690v4 =28 Cores No RAM/ HDD H730 4xRJ45

$189.00



Dell PowerEdge T330 Intel Xeon E3-1220 v5@3.0GHz | 8GB RAM | 4x 1TB HDD | NO OS picture

Dell PowerEdge T330 Intel Xeon E3-1220 v5@3.0GHz | 8GB RAM | 4x 1TB HDD | NO OS

$249.99



Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Cores  32gb  180GB SSD  495w picture

Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Cores 32gb 180GB SSD 495w

$164.99



Dell PowerEdge R730xd Server 2x E5-2697v3 2.60Ghz 28-Core 144GB H730P picture

Dell PowerEdge R730xd Server 2x E5-2697v3 2.60Ghz 28-Core 144GB H730P

$326.65



Dell PowerEdge R640 40 Core NVMe Server 2X Gold 6138 16GB RAM H730P 4X 1GbE picture

Dell PowerEdge R640 40 Core NVMe Server 2X Gold 6138 16GB RAM H730P 4X 1GbE

$463.93



Dell R640 8x 2.5

Dell R640 8x 2.5" SFF Server iDRAC - Wholesale Custom Build Your Server

$252.99



Dell PowerEdge R710 8SFF 2U Server 2x X5680 3.33GHZ 12-Cores / 128gb / 2x Trays picture

Dell PowerEdge R710 8SFF 2U Server 2x X5680 3.33GHZ 12-Cores / 128gb / 2x Trays

$184.99