08-07-2007
fork and exec ftp
Hi,
I need to find/implement an application that FTPs (puts) all new files in a certain directory to an external storage unit. This application should check for new files every 10 seconds (leaving the FTP connection open in between the 10 seconds).
The easiest way would be if there are programs that I can use on solaris to accomplish this (I know some on Windows, but none on solaris).
Or maybe it can be done with scripts ? (I have no experience with that)
Or I could (in C++) fork and exec (solaris ftp) and use 2 pipes to communicate between my parent process and the ftp. But I'm not sure if it's possible to catch the output of the solaris ftp in a pipe, so that I can use it in my parent process. Until now I've only used uni-directional communication between parent and child process.
I hope to get some ideas on what you think is the best way to do this.
Thanks.
10 More Discussions You Might Find Interesting
1. Programming
Hello!
I am working on a server where I should have 4 (resident)processes, one of them being "the father" of the others, so I do 3 forks. The problem that I have is that I do an accept (for sockets) in the "father" process and I want to transmit the job to one of the processes "child" with... (3 Replies)
Discussion started by: driki
3 Replies
2. UNIX for Dummies Questions & Answers
Hi!
Can someone explain me exactly this technique? Why a process (PARENT) creates a copy of itself with FORK (CHILD)? What's the reason of this behaviour? Sorry, but I cannot understand the logic behind it.
Thanks. (4 Replies)
Discussion started by: marshmallow
4 Replies
3. Programming
On my *nix box, I have a telegram program.
When I go like
tel person "la\nla\nla\n"
the person sees
"la\nla\nla\n"
However, when I have a program that forks and execs tel like:
pid = fork();
if (pid < 0) {
perror("fork failed");
exit(EXIT_FAILURE);
}
if (pid == 0) {... (7 Replies)
Discussion started by: frequency8
7 Replies
4. Shell Programming and Scripting
I need to ssh to a remote server and run my script there. This is my script.
$ssh = "ssh username@host";
$cmd = "$ssh 'cd <my dir> && < sudo Run_exe>'";
my $pid = fork;
if ($pid == 0){
exec $cmd;
}
When I run this I get:
pccons_getchar: got r == 0 (1 Reply)
Discussion started by: looza
1 Replies
5. Programming
Hello World!
I am writing code in C++ which have to launch another application X using exec().
I would like to set some limits on it using setrlimit etc...
My problem is that i don't know how to forbid using fork() and strlimit by application X.
How can i do it? (3 Replies)
Discussion started by: kzi
3 Replies
6. Programming
Hi All,
In my program i am handling SIGHUP signal. In the handler i fork and then exec on child process same binary file which is running. Parent process will die after 10 mins.
Now my child process which was exec with same binary file is not receiving SIGHUP signal. Below is the progran code:... (6 Replies)
Discussion started by: sushil_shalin
6 Replies
7. Programming
Hello everybody.I want to make clear that i am not going to ask from anybody to build my asignement but i have a big problem. I can't seem to find anywhere ONE good example on C about what i am trying to do:wall:.I think it is simple. All i ask is one example, even a link is fine.
So, i want to... (1 Reply)
Discussion started by: Cuervo
1 Replies
8. UNIX for Dummies Questions & Answers
What is is difference between 'fork with exec' and 'fork without exec'?
How both are related? (1 Reply)
Discussion started by: kkalyan
1 Replies
9. SCO
Hello dear Users,
I am for the first time in this forum. I come from Germany. Please excuse my bad englisch. My OS is SCO open Server Release 5.
I have a problem whith FTP and the command "site exec"
if I use the command "ftp> site chmod 777 /tmp/startkpf.sc
200 CHMOD command successful. ... (8 Replies)
Discussion started by: fla5do
8 Replies
10. UNIX for Beginners Questions & Answers
Hello... And thanks in advance for any help anyone can offer me on my question! I've been doing a lot of reading to try and find my answer... But I haven't had any luck
What I'm trying to understand is where a child process inherits global environment variables from? I understand the exec()... (2 Replies)
Discussion started by: bodisha
2 Replies
LEARN ABOUT OPENSOLARIS
gnome-vfs.applications
gnome-vfs.applications.4(4) File Formats gnome-vfs.applications.4(4)
NAME
gnome-vfs.applications - GNOME VFS application registry
DESCRIPTION
GnomeVFS is obsolete. Refer to the GNOME Desktop System Administration Guide for information about how to register MIME type information
with the GNOME desktop. The GNOME Desktop System Administration Guide can be viewed with yelp(1).
The GNOME MIME magic and MIME info files (see gnome-vfs-mime-magic(4)) enable GNOME VFS to associate a data file with its icon and descrip-
tion. The GNOME VFS application registry provides a way to launch the applications associated with such files.
The registration of applications to various MIME types is specified in text files placed in the /usr/share/gnome/application-registry
directory. GNOME provides a default registry file called gnome-vfs.applications. Vendor-specific registry files can also be placed in this
directory. This information is used extensively by nautilus(1), the GNOME file manager.
EXTENDED DESCRIPTION
The format of the application registry file is simple. Each application entry is made up of a name followed by a number of key-value pairs.
The application name must have been specified in one of the .keys files. The minimum required key fields are as follows:
command The command to execute.
name The descriptive name of the command, which will appear in the Open With menu in Nautilus.
can_open_multiple_files The value of this field can be true or false.
expects_uris The value of this field can be true or false. This field tells Nautilus whether the application can accept http:,
ftp: and so on specifications to open at the command line. If this is true, you must add the supported_uri_schemes
field.
requires_terminal The value of this field can be true or false.
mime_types The list of comma-separated mime-types defined by MIME magic or MIME info files.
Optional field:
supported_uri_schemes Specifies the list of protocols supported by the application; for example, http, ftp, file, telnet, gopher.
EXAMPLES
Example 1: Registering CDE Imagetool with GNOME Application Registry
sdtimage
command=sdtimage
name=sdtimage
can_open_multiple_files=false
expects_uris=false
requires_terminal=false
mime_types=image/tiff,image/gif,application/postscript,image/jpeg,x-xpixmap
Example 2: Registering Netscape with GNOME Application Registry
netscape
command=netscape
name=Netscape
can_open_multiple_files=true
expects_uris=true
requires_terminal=false
supported_uri_schemes=file,http,ftp,telnet,gopher
mime_types=text/html,x-directory/webdav,x-directory/webdav-prefer-directory,image/gif,image/jpeg
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of gnome-vfs.applications: NLSPATH.
FILES
The following files are used by this application:
/usr/share/gnome/application-registry/gnome-vfs.applications
/usr/share/gnome/application-registry/solaris-gnome2.0.applications
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-vfs |
+-----------------------------+-----------------------------+
|Interface stability |Obsolete Volatile |
+-----------------------------+-----------------------------+
SEE ALSO
nautilus(1), gnome-vfs-mime-magic(4), libgnomevfs-2(3), gnome-interfaces(5)
Latest version of the GNOME Desktop System Administration Guide for your platform.
NOTES
Written by Ghee Teo, Sun Microsystems Inc., 2003.
SunOS 5.11 14 May 2008 gnome-vfs.applications.4(4)