Sponsored Content
Top Forums Programming Accessing directories in Linux Post 302985701 by Corona688 on Monday 14th of November 2016 11:07:51 AM
Old 11-14-2016
You're very, very close - close enough that I wonder if this is permissions issues rather than program ones... Or, perhaps, parts of the program we didn't see, preventing it from working.

By the way, if this is the sort of C++ program that's line after line of system(), it'd probably be more easily "ported" to shell script.
 

10 More Discussions You Might Find Interesting

1. IP Networking

Problem accessing network using Linux

Ok, here at work, we have Windows computers which login into a MS domain server. Some of us also have Linux boxes which get a ip address from the dhcp server. We can see other boxes and see the internet until about 1 week ago. Now, we still get a ip address but can't see anything within our... (3 Replies)
Discussion started by: natter
3 Replies

2. Linux

Accessing FTP on Linux

Hi, I've setup an FTP server on my linux box (RH 9.0). I've configured so the vsftpd daemon is running in runlevel 5, etc. However, I have difficulty logging-on, as it will not authenticate any valid user (inlcuding anoymous). Everything seems ok in the /etc/vsftpd/vsftp.d.conf and... (4 Replies)
Discussion started by: Breen
4 Replies

3. IP Networking

Accessing a FTP Server hosted on Linux

We have set-up a FTP server on a Linux machine, which sits behind a firewall. Most users outside our firewall can access it, but one user in particular cannot. I assume it has something to do with their firewall rules. It appears that they can connect with no problem but the server does not grant... (1 Reply)
Discussion started by: Breen
1 Replies

4. UNIX for Dummies Questions & Answers

Accessing UNIX Data over LINUX

Hello! Unfortunatly i'm totaly new with UNIX and LINUX... Actually Problem is i have some data on floppy disk which was written on UNIX system 5 version now i have installed LINIX ver 9 is there any way i can access unix data on linux 9? if so please reply me with commands i shall be very... (2 Replies)
Discussion started by: xohaib
2 Replies

5. IP Networking

Accessing linux via telnet

I have installed linux in my virtual PC under my windows system. I am trying to access it via windows using putty but i couldn't do so. Could you please help me gurus. (4 Replies)
Discussion started by: Krrishv
4 Replies

6. Red Hat

accessing windows 2k3 partition from Linux Advance Server 3

Dear all i hav dual operating system ie windows 2003 and Red Hat Advance Server3 trying to mount windows partition on linux operating system using the following method 1)mkdir /mnt/windows 2)mount -t ntfs /dev/hda1 /mnt/windows mount: fs type ntf not supported by kernel and my kernel... (2 Replies)
Discussion started by: maooah
2 Replies

7. UNIX for Dummies Questions & Answers

Looking for application that simplifies for non techie people accessing unix/linux env

Hello all I searched the net but didn't found any application that wrap ssh connection with GUI interface so that non techie people can connect to unix/linux accounts and work with files , so it will looks like there familiar Microsoft windows directory structure . Please don't answer with ..... (6 Replies)
Discussion started by: umen
6 Replies

8. Linux

Problem in accessing Oracle Database Server from Linux Machine

I am facing a strange issue in connecting to Oracle database from Linux Machine - The connectivity is not failing all the time , the failure to success ratio is 1:70. - Error "ORA-12545: Connect failed because target host or object does not exist" - Majority of the time the connection... (6 Replies)
Discussion started by: balaji kumar
6 Replies

9. Shell Programming and Scripting

Accessing multiple directories in loop

Hi Guys, I need to access multiple directories whcih is following similar structure and need to copy those files in desitination path. for eg : if ] then cd ${DIR}/Mon/loaded echo "copying files to $GRS_DIR" cp * ${DIR}/Mon/ echo "Files of Monday are Copied" fi if ] then... (5 Replies)
Discussion started by: rohit_shinez
5 Replies

10. UNIX for Dummies Questions & Answers

Linux question on directories..

Hi, First server every thing is working but keeps crashing so to be on the safe side created second server and moved all the files. But I notice there is a " dot " at the end. See below. Not sure what that means. Also getting 403 on Apache. Please see below. Thanks you so much. ls -l... (4 Replies)
Discussion started by: samnyc
4 Replies
FEXECVE(3)						     Linux Programmer's Manual							FEXECVE(3)

NAME
fexecve - execute program specified via file descriptor SYNOPSIS
#include <unistd.h> int fexecve(int fd, char *const argv[], char *const envp[]); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): fexecve(): Since glibc 2.10: _POSIX_C_SOURCE >= 200809L Before glibc 2.10: _GNU_SOURCE DESCRIPTION
fexecve() performs the same task as execve(2), with the difference that the file to be executed is specified via a file descriptor, fd, rather than via a pathname. The file descriptor fd must be opened read-only (O_RDONLY) or with the O_PATH flag and the caller must have permission to execute the file that it refers to. RETURN VALUE
A successful call to fexecve() never returns. On error, the function does return, with a result value of -1, and errno is set appropri- ately. ERRORS
Errors are as for execve(2), with the following additions: EINVAL fd is not a valid file descriptor, or argv is NULL, or envp is NULL. ENOSYS The /proc filesystem could not be accessed. VERSIONS
fexecve() is implemented since glibc 2.3.2. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +----------+---------------+---------+ |Interface | Attribute | Value | +----------+---------------+---------+ |fexecve() | Thread safety | MT-Safe | +----------+---------------+---------+ CONFORMING TO
POSIX.1-2008. This function is not specified in POSIX.1-2001, and is not widely available on other systems. It is specified in POSIX.1-2008. NOTES
On Linux with glibc versions 2.26 and earlier, fexecve() is implemented using the proc(5) filesystem, so /proc needs to be mounted and available at the time of the call. Since glibc 2.27, if the underlying kernel supports the execveat(2) system call, then fexecve() is implemented using that system call, with the benefit that /proc does not need to be mounted. The idea behind fexecve() is to allow the caller to verify (checksum) the contents of an executable before executing it. Simply opening the file, checksumming the contents, and then doing an execve(2) would not suffice, since, between the two steps, the filename, or a direc- tory prefix of the pathname, could have been exchanged (by, for example, modifying the target of a symbolic link). fexecve() does not mit- igate the problem that the contents of a file could be changed between the checksumming and the call to fexecve(); for that, the solution is to ensure that the permissions on the file prevent it from being modified by malicious users. The natural idiom when using fexecve() is to set the close-on-exec flag on fd, so that the file descriptor does not leak through to the program that is executed. This approach is natural for two reasons. First, it prevents file descriptors being consumed unnecessarily. (The executed program normally has no need of a file descriptor that refers to the program itself.) Second, if fexecve() is used recur- sively, employing the close-on-exec flag prevents the file descriptor exhaustion that would result from the fact that each step in the recursion would cause one more file descriptor to be passed to the new program. (But see BUGS.) BUGS
If fd refers to a script (i.e., it is an executable text file that names a script interpreter with a first line that begins with the char- acters #!) and the close-on-exec flag has been set for fd, then fexecve() fails with the error ENOENT. This error occurs because, by the time the script interpreter is executed, fd has already been closed because of the close-on-exec flag. Thus, the close-on-exec flag can't be set on fd if it refers to a script, leading to the problems described in NOTES. SEE ALSO
execve(2), execveat(2) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 FEXECVE(3)
All times are GMT -4. The time now is 03:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy