C :: How To Delete Files After SIGINT Has Been Send To Interrupt The Process

May 12, 2013

I have a program that makes a directory (temporary) and in it some files that are necessary for computation while program is running. Now suppose a user decides to interrupt the program at some stage. what happens is that the program stops but my folder and files remain.

Q: How to override SIGINT command so that before the the execution stops the folder is deleted ?

View 4 Replies


ADVERTISEMENT

C/C++ :: Send Signal SEGV To Crash A Running Process In Windows To Dump Core

Jul 2, 2014

I need to do an equivalent of kill -11 <pid>(which is in unix) in windows.

I need to crash a process with SEGV so that it would dump core in windows. Is there any tool by which we can do this . Also is there any sample code through which we can achieve this .

In windows we have taskill which only terminates a process , but is unable to send a signal like SEGV to the process upon which it would terminate and dump core .

View 9 Replies View Related

C :: File Process - Delete Or Update Information

May 18, 2013

i have written a student information storing program. it has add,delete,list,and update menu (in program i have written update == uptade,i know : P )

my question is i cant delete or update the information. where is my failure ?

Code:

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#define max 3
struct og {
char id[12];

[Code]...

View 2 Replies View Related

C++ :: Process To Delete Everything From Single Linked List

Aug 23, 2013

what is the process to delete everything from a singly linked list. Like S= 1->2->3->... I want to remove all the values from S and reuse it again to store new datas.

View 2 Replies View Related

C Sharp :: Replace Or Delete Image That Has Been Used By Another Process Previously

Apr 6, 2012

I'm using web cam to save,update the image in base directory folder.I can save the image but, while attempting to update the image..I caught an error!!

C#.Net:
The process cannot access the file 'C:..~..inDebugcustomer_photos10.jpg' because it is being used by another process.

View 2 Replies View Related

C :: Using COM Ports To Send Files Between Two PCs

Dec 2, 2014

My first time programming sth in Network. I have to use C to send a file to another PC, well COM port are useful but I didn't find how to refer to the address of my destination.

View 4 Replies View Related

C# :: Send Multiple Files Over Tcp At The Same Time In C Sharp?

Nov 29, 2010

I have a tcp client - server implementation running in the same program, on different background worker threads. There will be instances of this program on multiple computers so they can send and receive files between each other. I can send files sequentially between computers using network stream, but how would I send multiple files at the same time from computer A to B.

Sending multiple files over one connection ( socket ) is fine, but having multiple network streams sending data to a client, the client doesn't know which chunk of data is apart of which file ?

View 3 Replies View Related

C++ :: Multiplethread - Sequentially Process Large Number Of Files

Jan 14, 2014

We have a program that sequentially processes a large number of files (currently about 700 expected to increase to about 1500). The program performs the same processing on each file (and doesn't involve any other file) which is io-bound and not cpu-bound. This process takes several hours and it is normally performed overnight.

I've refactored the program so that the processing for each file is done within its own thread (ie one thread created for the processing of one file). This gives rise to many hundreds of io-bound threads. This refactored program is working with no errors reported and has reduced the total processing time down to about 10 minutes.

Any problems that might arise having this number of threads (700 to 1500) created/running?

View 14 Replies View Related

Visual C++ :: Application That Process Multiple Files Through Command Prompt Call

Dec 22, 2012

I am making an application that processes multiple files (typically > 500) through a command prompt call. The way I start the command prompt app is by looping using a call to CreateProcess for each file that is to be processed. It works fine, except that I somehow loose 'connection' to my app so that

1: Windows says that the app. is 'Not Responding'
2: The Cprogress bar in my app is not updated before all files have been processed, even though there is a CreateProcess call and a Cprogress.StepIt() from the app for each file that needs processing.

I somehow suspect that the CPU gets swamped... I do not want that Windows starts to say that my app is 'not responding' and I want my Cprogress dialog bar to update according to the number of files that are progressed through.

I wonder if multithreading is the OK way to go instead of just kicking of series of CreateProcess calls? Maybe my CreateProcess is not ending correctly? It seems as if my app is 'not regaining control' before very late. The app never crashes though.

My CreateProcess code is listed below, maybe there can be a problem with it, or maybe I should do things in a different way? My app basicaly works as it never crashes, but with above mentioned problems it is NOT a pro solution...

void CMultiFilerDlg::ProcessFile(CString pdfFile) {
int i=0;
DWORD ProcID;
// Open file in text mode:
STARTUPINFO si;
PROCESS_INFORMATION pi;
char cmdArgs[2052];

[Code] .....

View 6 Replies View Related

C :: SIGINT And Cleanup Not Working

Dec 3, 2014

I have written a program to receive data from a client and log it in a file. But for some reason my SIGINT and cleanup function are not working. The server continues to run in the background.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>

[Code].....

View 3 Replies View Related

C++ :: Delete Files With Same Size

Apr 28, 2013

So, i got a directory full of files. Some files are duplicate and i'd like to delete those duplicate files. The only way to recognize duplicate files is their size. So how would i delete them?

View 4 Replies View Related

C/C++ :: How To Use Text Files As SQL Fields To Edit / Delete And Modify Records

Aug 19, 2013

I want to search and display the field stored in text file and also i want to delete the field that is entered. Case 3 and 4 is incomplete.

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main() {
    int a;
    int st_id;

[Code] ....

View 6 Replies View Related

C :: Using RA2 As Both Input And Interrupt

Feb 16, 2013

I brought some code from a PICDEM DV lab example into a simple program I'd written. The example showed how to use the external interrupt on the PIC16F690 to switch directions in a function.

I've been trying to use that RA2 pin as both the input (start) trigger for one of my functions and as an interrupt to get out of that function, too. So far the interrupt doesn't work, but the function trigger does. Should I use two pushbuttons or add a random timer to the for() loop to execute the function to roll the dice?

Trying to incorporate that example code also seems to have messed up the little random counter [a for() loop] that I used. The dice pattern was reliably random before adding this new stuff, and now I can clearly see repetition.

I'm only just starting a MC class.

Code:
#pragma config FOSC = INTRCIO // Oscillator Selection bit
#pragma config WDTE = OFF // Watchdog Timer Enable bit
#pragma config PWRTE = OFF // Power-up Timer Enable bit

[Code].....

View 3 Replies View Related

C :: Disable Interrupt In ARM M0 Program

May 6, 2014

How do i disable the interrupt in this ARM M0 univesity design start program? The design is made for the M0 and echos an inputted char as an integer, it is part of a larger piece of code (which is ommitted for simplicity).Can i do it in the main program(attached) or will i have to edit the assembler code.

Code:

// Cortex-M0 DesignStart C program example
#include <stdio.h>
#include <time.h>
#include <rt_misc.h>
#include <stdlib.h>
}

[code]....

View 2 Replies View Related

C :: Write A Interrupt To Add Another Sensor For Robotic Car?

Mar 30, 2014

This is a program that is for a robotic car. The car has two light sensors on the front to detect when it veers off the road. When a sense is detected on one of the sensors the corresponding motor will halt until the sensor again detects the track. Again two sensors, left and right, and two motors (one per wheel). I have case statements to do the two left and right sensors.

how would I implement a third sensor with an interrupt to halt the car after it senses a stoping line. E.g. the sensor in the middle detects the stopping point so both motors halt.Here is the code I have so far...The cases are the sensor detections.

Code:

#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
// Function Prototypes
void init_PWM(void);
void initLCD(void);

[code]....
}

View 4 Replies View Related

C :: List - Why Delete Function Doesn't Delete

Dec 9, 2014

I have to manage a Clinic. I need to delete a booking (for example, if John said he's coming on March 22nd at 15:30 but then he say he's not going to come, I have to delete that booking so another person can use it).

idSearched: the id of the person that is not going to come. I have a lot of specialties and each one has a list. So I ask for the speciality to delete the node (the node contains John's booking). If I don't find it, I return (-1). searchSpecByID return a pointer to the list where the speciality is. So head will point to the first node of the list. In nodeToDelete I have the node I want to delete.

The program detects OK when is the first in the list and when not, but it doesn't delete the node.

Code:

typedef struct bookingList{
tSpecialty specialty;
struct nodo* intro;
} tList;

[Code].....

View 7 Replies View Related

C :: Program To Hide Files Behind Other Files Using Alternate Data Streams

Apr 5, 2013

I am writing a program to hide files behind other files using Alternate Data Streams in Windows NTFS file systems.

The program is as follows:

Code:

#include <stdio.h>
#include <stdlib.h>
int main(void){
char hostfile[75], hiddenfile[75], hiddenFileName[15] ;
printf("Enter the name(with extension) and path of the file whose behind you want to hide another file: ");
scanf("%75s", hostfile);

[Code]...

The complier is showing error as "Extra Perimeter in call to system" but I am not getting where?

View 4 Replies View Related

C++ :: Display Last 1000 Lines From Multiple Text Files (log Files)

Jan 16, 2014

I am writing a piece of code that requires me to display the last 1000 lines from a multiple text files (log files). FYI, I am running on Linux and using g++.

I have a log file from which - if it contains more than 1000 lines, I need to display the last 1000 lines. However, the log file could get rotated. So, in case where the current log file contains less than 1000 lines, I have to go to older log file and display the remaining. For e.g., if log got rotated and new log file contains 20 lines, I have to display the 980 lines from old log file + 20 from current log files.

What is the best way to do this? Even an outline algorithm will work.

View 6 Replies View Related

C :: GTK In Forked Process

Dec 13, 2013

I have app that has while true on input listening to changes and then in some condition needs to open simple gtk app, and afterwards continue listening.

I thought that i could fork gtk part, and kill it when it is not needed.

But am not finding much examples on internet. 2 processes dont share data. Can child process start a gui app? And is this a good approach.

View 1 Replies View Related

C/C++ :: How To Run A Process From Memory

Mar 8, 2013

I am looking for a way to run a process form memory, without having any executable. The application will be kept inside a resource and will be extracted during run time. It should be then started as a new process. I couldn't find a solution that works also on x64

View 5 Replies View Related

C :: Using Process ID As The Name Of File Directory

Jan 31, 2015

I need my Unix program to generate a directory with a format like this: "hinesro.<pid>". I have some code that mostly works, except for the directory ends up with a question mark on the end, like this: "hinesro.12345?". I need it to just display the directory without this question mark. Here is my code:

Code:

// Using headers sys/types.h, sys/stat.h, unistd.h, and stdio.h
int pid = getpid();
char prefix[] = "hinesro.";
char fileName[0];
sprintf(fileName, "%s%d
", prefix, pid);

[Code]...

View 13 Replies View Related

C++ :: Inheritance Slows Down Process

Sep 5, 2013

i have read that inheritance slows down the process.because a_class -> b_class -> c_class it goes thorough many classes to find a function or a value. people advices not to do it more than a few times. what if instead of inheritance we are using headers, would it slow down the process also??i mean which one is faster? and arent both the same when we use headers or used inheritance.

View 3 Replies View Related

C++ :: How To Create Zombie Process

Nov 25, 2014

I am looking into how to create zombie process. They are created when parent process don't call wait() and hence they are not removed from the process table. How do I create zombie process in C++? What part of the code when missed, make a process/thread zombie? Is it the pthread_join()?

View 2 Replies View Related

C# :: Multitasking On Process And Progress Bar?

Apr 9, 2015

Am developing windows forms application where in my form am fetching data into list from some object which takes around 2 minutes to complete processing so meantime i want to show progress bar before starting process till it ends with percentage. I have return a code to do multitasking but it is throwing error as "Cross-thread operation not valid: Control 'listOrg' accessed from a thread other than the thread it was created on".

private void btnOrg_Click(object sender, EventArgs e) {
try {
// To report progress from the background worker we need to set this property
backgroundWorker1.WorkerReportsProgress = true;

[code]....

View 1 Replies View Related

C# :: How To Edit Process Memory

Mar 29, 2014

I would like to ask about editing proccess memory.For example,I would like to create some program for a multiplayer game which I play.How do I work with memory adresses and what are commands for it.

View 1 Replies View Related

C/C++ :: Why Won't Functions Process New Values

Nov 5, 2014

I was given an assignment where I have to input two points (four integers) on a Cartesian plane from a file and then process it using functions. My professor is very particular so the comments are a bit excessive, but here's what I have.

double radiusFn(double, double, double, double);//4 double values, one for each point. All points are needed for the calculation of distance in this function.
double diameterFn(double);//Only uses one double value - the radius. Both functions below use the same value.
double circumferenceFn(double);
double areaFn(double);
int main() {

[code].....

The file reads:

Quote

1 2 3 4 5 6 7 8 9 10 11 12

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved