C++ :: How To Protect Entire TMP Directory
Mar 13, 2014
The general design of my app work-flow:
My application is processing a large amount of data (approx. 50 - 100 GB of txt data). given the machine regular user usually has, my app is writing some tmp data into a local tmp directory. and this is working just fine until users get comfortable with my software and start changing that content of local tmp dir (while the program is running). which does not give any problems like crashing a program if handled at the right time but produces wrong results in the end. now this is not my problem but i would still like to somehow restrict users from even peeking into the tmp dir. I am just tired of getting emails saying my software is cr.... (maybe it is but i don't think it is because of that)
So is it possible to somehow encrypt the entire dir so that only the program has access to it . it would be even better if the dir could look as some encrypted index file so that when user sees the warning :
"tmp" may be a binary file. See it anyway?
View 6 Replies
ADVERTISEMENT
Apr 20, 2014
is there any way to copy an entire list to a vector? would make my life much easier
View 3 Replies
View Related
Dec 12, 2013
Okay so I've declared an array like this.
Foo *Blocks[100][100][10000] = {0};
And as far as my understanding goes This creates an array with every member set to NULL.
And then later on in my code some of these get given values using:
Blocks[a][b][c] = new Foo;
And then when I want to unload I would think that I could just go
Blocks = {0};
But obviously this doesn't work.
So I was wondering if there was a way of doing This, with out creating a loop and changing every one to NULL manually.
View 8 Replies
View Related
Oct 16, 2013
If I have a char array that that looks like
char array[] = {'a', 'b', 'c'};
How can I check user input against all of these values at once?
View 7 Replies
View Related
Feb 3, 2014
I just want my program to run continuously until someone enters 0 to exit it. I tried doing while(x=1) and looping my entire block of code. Also there is a switch one is a for one is a while loop both doing the same function. I have basic error checking and whatnot.
/*This is a program that gets a user to input a starting and ending value.
The code then prints the number ie 1 and 5 would be (1,2,3,4,5) and all the squares and cubes.
There is a case statement asking weather you want to run it as a for or as a while loop.
The choices are case sensitive.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>//allows for power and cube function
int x;
int main(){
[Code] ....
View 4 Replies
View Related
Feb 26, 2013
is there anyway to read an entire file and print in on screen? file consists of strings and integers!
View 7 Replies
View Related
Dec 11, 2014
I have it searching through the entire string letter by letter, looking for spaces, punctuation, etc... yet it still is continuing on with the space.
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <stdio.h>
#include <cctype>
#include <algorithm>
[Code] ....
Output:
if(str_word == " ")
//or
if(str_word == ' ')
It does nothing to change it. I am completely baffled.
View 4 Replies
View Related
Jan 28, 2013
I would like to store the entire content of a file in a single c-string variable or in a standard string class variable. Is there a function that will do this for me? I am familiar with functions that get one character or one line at a time but I don't think I've encountered a function that gets the entire file. Does this function keep or disregard the end-of-line character? If no such function exists, I would write my own function to create and return such a variable.
View 4 Replies
View Related
Apr 15, 2014
I am working on a drink machine simulation. I have a text file that holds the prices, names and inventory. My problem is It won't let me set my prices at 1.00 or higher. Ex: I set the price to 1.50 in the text file then when it reads the info and stores the price it only stores .50 instead of 1.50.
my code:
#include <iostream>
#include <string>
#include <fstream>
[Code].....
View 1 Replies
View Related
Apr 15, 2014
I am working on a drink machine simulation. I have a text file that holds the prices, names and inventory. My problem is It won't let me set my prices at 1.00 or higher. Ex: I set the price to 1.50 in the text file then when it reads the info and stores the price it only stores .50 instead of 1.50.
textfile looks like this:
Apple Juice 1.50 20
Mango Juice 1.50 20
Sprite Mix 1.90 20
Coca Cola 1.90 20
[Code].....
View 2 Replies
View Related
Apr 4, 2013
I have a gridview in which I show report data, I wanted to print this data, so I added print functionality. This print functionality does not print entire gridview data, it only prints data which is visible on the screen and skip the data which is under vertical scroll bar.
Below is the print grid view code in c# for WINDOWS APPLICATION.
private void btnPrint_Click(object sender, EventArgs e)
{
if (printDialog1.ShowDialog() == DialogResult.OK)
{
[Code]....
View 3 Replies
View Related
Mar 30, 2014
I am writing a program which compresses files into .zip files.
Here's my problem: Whenever I want to compress an executable file, my readFile function does not read the entire file. When I extract the .exe I get a very tiny and incomplete file.
Here's the function I use to read files:
std::string miniz_wrapper::readFile(FILE* f, int MAX_FILEBUFFER)
//MAX_FILEBUFFER has a default value of 65536 {
char* tmp;
std::string tmp_s;
int count = 0;
[Code] .....
Prior to reading, every file is opened using fopen with the mode "rb".
View 6 Replies
View Related
May 24, 2014
As you can see, the code below calculates the average, sum, number of items, etc, for a list of numbers in two separate files and compares them with one another.
e.g. we will have a text file of 10 numbers;
45
65
24
26
26
36
35
100
109
433
etc...
The problem is that the code will perform calculations on all the numbers in the txt. or csv. file. This is problematic because if there is any text in the file, e.g. headings, then the calculations will not be performed. For instance, suppose that I only wanted to include rows 5-10 in the calculations, how would I specify this in my C++ code?
#include <iostream>
#include <cmath>
#include <math.h>
[Code]....
View 3 Replies
View Related
Apr 17, 2014
I was trying to capture entire web screen and save as .jpeg format.
So far I have done this using C# Windows Application.
Same thing I am willing to do in 'VC++ 2010 Win32. In my C++ project I have created a Toolbar with a button on IE 9 browser. And on Toolbar button click I can print current window.
But I don't know how to take a snapshot and save to specified directory in .jpeg format using VC++ 2010. I have Windows 7.
View 4 Replies
View Related
Apr 1, 2014
i've been trying to figure out to search for a word in a text file and then display everything in the same row as the word found int ie this is whats in the file
john doe 3/21/1920 tech support review team 45,000
so user wants to find tech..and everything associated with it.
so program search for tech, when it does it then display the whole row.
john doe 3/21/1920 tech support review team 45,000
I can figure out how to search for a word, but no clue how to get it to then print out the row. This is all I can figure out to do.
ifstream FileSearch;
FileSearch.open("employee");
if(FileSearch.is_open())
{string letters;// search word would be store here
string row; ??stores entire row as string
while(1)
[Code]....
View 14 Replies
View Related
Jul 31, 2013
Take for example two arrays.
int A[2][2][2] = { {{1, 2}, {3, 4}},{{ 5, 6}, {7, 8}} };
int B[1]
I want to store the entire array "A" into B[1]. Is it possible?
View 2 Replies
View Related
May 11, 2013
How do you create a new directory in C++? I would like to do this using the standard library and no external, third party or non standard libraries/headers. I need to do this without calling system() or system("mkdir").
View 7 Replies
View Related
Apr 24, 2014
How to change directory in c++ ( windows ) I want to go to the folder "example2" and I delete some files and then return to the original folder c++ - windows
View 7 Replies
View Related
Oct 20, 2014
I want to obtain the user's home directory. I know it can be done with getenv("HOME"), but if I'll inspect the value of the enviroment variable HOME, it might work when I run it now, but it won't work on Windows, since windows uses HOMEPATH to save the user's home directory.
Is there a different, more cross-platform way to do it?
View 5 Replies
View Related
Dec 6, 2013
I'm writing a program to merge all .txt files in a directory. I had the code working and then made small change. It started crashing and I couldn't get it back to working.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
[Code] ....
It's crashing around the
Code: while(!feof(in)){ .
If I comment that section out, the code still works. But, I know that portion of the code works to copy text from one file to another! It's actually from the Schildt complete C reference and I have tested it several times on it's own.
View 5 Replies
View Related
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
Apr 26, 2013
I have problems opening a file within a directory.
#include <dirent.h>
#include <string>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
[Code] .....
Error Message:
$ ./dirsearch ~/Documents/College/textfiles/
[..]
[yomama.txt]
Error : Failed to open entry file - No such file or directory
Here are my current file permissions:
textfiles$ ls -l
total 8
-rw-rw-rw- 1 jav jav 7 Apr 26 13:14 moretext.txt
-rw-rw-rw- 1 jav jav 10 Apr 26 12:38 yomama.txt
View 6 Replies
View Related
Aug 5, 2013
I tried listing files using the code given in "[URL] ..." the program listed all the files present in the current dirctory but if i change the drive and the directory to such as
"C:UsersBaaooDownloadsdirect.h function"
the program does not list files name.
#include <iostream>
#include <dirent.h>
using namespace std;
int main() {
DIR* dir;
dirent* pdir;
[Code] .....
View 1 Replies
View Related
Aug 29, 2013
I was working on a program. "hey if this program were to be published it would be bad for people to see all dll files are in the exe directory"....
So I wondered if there is a way to make compiler see a folder in the same directory with exe file which holds all dll files?
Also look at some programs and saw they have a dll folder which holds dll files....
View 1 Replies
View Related
Jan 12, 2015
Taking a OS course and my professor gave us files to reference in a directory located at ~agw/class/os/share/proj3. But when I typed this into the terminal I keep getting a permission denied error message.
[lastname@erdos ~]$ ls
dead.letter Desktop Documents Downloads Music Pictures private Public public_html Templates Videos
[lastname@erdos ~]$ ~agw/class/os/share/proj3
/u/sobolev/agw/class/os/share/proj3: Permission denied.
[lastname@erdos ~]$
I'm not sure what I am doing wrong. Ive opened shared directories for this class before and had no issues.
View 1 Replies
View Related
Dec 9, 2013
Taking a OS course and my professor gave us files to reference in a directory located at ~agw/class/os/share/proj3. But when I typed this into the terminal I keep getting a permission denied error message.
[lastname@erdos ~]$ ls
dead.letter Desktop Documents Downloads Music Pictures private Public public_html Templates Videos
[lastname@erdos ~]$ ~agw/class/os/share/proj3
/u/sobolev/agw/class/os/share/proj3: Permission denied.
[lastname@erdos ~]$
I've opened shared directories for this class before and had no issues.
View 2 Replies
View Related