I'm a beginner in ruby and in programming as well and need help with system call for moving a file from source to destination like this:
system(mv "#{@SOURCE_DIR}/#{my_file} #{@DEST_DIR}/#{file}")
Is it possible to do this in Ruby? If so, what is the correct syntax?
...
Why fork() before setsid() to daemonize a process ?
Basically, if I want to detach a process from its controlling terminal and make it a process group leader : I use setsid().
Doing this without forking before doesn't work.
Why ?
Thanks :)
...
I am running a command to push files to Google App Engine, and it might ask me for my email and password:
$ appcfg.py update .
Application: my-cdn; version: 3. # printed out
Server: appengine.google.com. # printed out
Scanning files on local disk. # printed out
Initiating update. # printed out
Email: [email protected] # now it asks me...
...
How can I protect my web server, if I run custom users code on server. If any user can submit his python source on my server and run it.
Maybe some modules or linux tools for close any network and hardware activity for this script.
Thank's all for help!
...
I have a widget that changes some system settings, but it will not take right away. It seems like I need to refresh the system settings for it to take. How do you change some system settings from a widget that take instantly?
when my widget is pressed it goes to an activity with a blank background to change the system settings. one of...
I am trying to use OpenCV (a computer vision library), which appearently uses a few .dll files, located in C:\OpenCV\bin (which has been added to the system PATH variable). However, if I try to run a simple test program, it gives a system error: "The program can't start because highgui.dll is missing from your computer. Try reinstalling ...
Hi All,
I'm writing a program in C++ which do some special treatment for all the files in the current directory on Linux OS.
So i was thinking of using system calls such as system("ls") to get the list of all files.
but how to store it then inside my program ? ( how to redirect the output of ls to let's say a string that i decl...
Hey guys,
I'm trying to find a way to use the original Apple system buttons and icons in a web site.
Is there a way to get these original graphics in png format?
There are not-so-nice ways to obtain them of course. Two I was thinking of:
Save them from this link, then convert to png.
Take screen captures on the iPhone itself, and ...
Let's say for example I wanted to echo "You are using Windows!" or "You are using Macintosh!", depending on the users OS. Is this possible?
...
I want to run some commands using the system() command, I do this way:
execute_command_error("trash-put '/home/$filename'");
Where execute_command_error will report if there was an error with whatever system command it ran. I know I could just unlink the file using Perl commands, but I want to delete stuff using trash-put as it's a ty...
Does anyone know of a macro function in OpenOffice like exec() or system() in other languages?
...
Hey,
The question speaks for itself : is there a convenient wrapper for system specific function in Qt, so I can tell how much is the current resources usage ?
I want to execute some expensive task when the system is idle. For your information (I might need to put that in another question), I want to calculate the content hash of a fil...
So here is a strange error/bug/idk ... I'm running jruby 1.4 with ant 1.8 ... from within jruby I execute an ant task with system(command_to_execute_ant_script) and everything works as expected ... however if the ant should sleep for longer than 9 seconds the script does not return EVER from within jruby. If the script sleeps for ex...
How do I execute another program from within a C program in Windows 32 - in a similar way as Perl's system() function or Python's sub-process module - such as DEL, REG, or other cmd.exe programs?
...
#!/usr/bin/env perl
use warnings; use strict;
use 5.012;
use IPC::System::Simple qw(system);
system( 'xterm', '-geometry', '80x25-5-5', '-bg', 'green', '&' );
say "Hello";
say "World";
I tried this to run the xterm-command in the background, but it doesn't work:
No absolute path found for shell: &
What would be t...
Hi there,
I am working on a windows installer project. And now I only want the software only can be installed on Windows 7 or Windows Server 2008 R2 system, I tried to use this:
<Condition Message='Windows Server 2008 R2 or Windows 7 is required'>(VersionNT = 600 AND ServicePackLevel = 1) OR VersionNT = 601 </Condition>
but it can st...
Is there a way to access (and call) procedures like _CopyArray that are defined in the interface in the unit System?
NB: I am trying to create a routine that makes a deep clone of any dynamic array, and do not use Delphi 2010 (using Delphi 2007).
The reason why I am trying to solve this without using Copy is the fact that I have only a...
Suppose a UNIX file system has some constraints--say, 2 KB blocks and 8B disk addresses. What is the maximum file size if inodes contain 13 direct entries, and one single, double, and triple indirect entry each?
...
I have a problem with iconv tool. I try to call it from rake file in that way:
Dir.glob("*.txt") do |file|
system("iconv -f UTF-8 -t 'ASCII//TRANSLIT' #{ file } >> ascii_#{ file }")
end
But one file is converted partly (size of partialy converted: 10059092 bytes, before convertion: 10081854). Comparing this two files prove that not ...
The (hypothetical for now) situation is the user of my system is going to be given a chunk of C code and needs my system to compile and run it in a chroot sandbox that is generated on the fly and I want to require the fewest files in the box as possible. I'm only willing to play with compiler and linker settings (e.g. static link everyth...