C :: Check If Certain Files Exist If So Open Them
Jan 24, 2014
I want to check if there are files present in a directory that match a certain regex, i.e., "reader_contact_info_%d", and if there are, I'd like to get the names of these files, perhaps the number that exist, and then open them and read them.
I could do something via executing an ls command Code: ls reader_contact_info_* but there are performance implications as the current process will suspend while the ls command executes.
I'm not sure how to do this though? It doesn't have to run on Windows, so that's not a problem.
View 4 Replies
ADVERTISEMENT
Apr 28, 2014
I am currently working on a C++ program for school. I am actually not finding too much difficulty in constructing the functions, enum-types, arrays and structs, however, I am finding great difficulty in using on ifstream variable to open multiple files.
I have posted the entire code that I have so far (even though I have pinpointed the issue to not properly opening the second file in ifstream).
I spent a couple of hours getting rid of certain functions/procedures, loops and variables and I get the same output (if what I removed doesnt crash it). I also get the same output whether I "open" the second file or not (meaning I removed all of the code for it and got the same output).
Here is the code (it's not finished because I am stuck on this file issue). It's a bit messy since I am now in debug mode versus program mode:
View 8 Replies
View Related
Dec 21, 2014
Right now, I have and application that opens a multi file dialog box. I want to take all of the files I highlight when the dialog box shows up and display a messsage box with the path and file names. This is what I have right now:
Code:
private: System::Void button1_Click_1(System::Object^ sender, System::EventArgs^ e) {
String^ folderName;
Stream^ myStream;
OpenFileDialog^ openFileDialog1 = gcnew OpenFileDialog;
openFileDialog1->Multiselect = true;
[Code] ....
Currently, it only shows the first file that I choose. I want to make it so that the message box shows all of the files that I select when the open file dialog shows up.
View 2 Replies
View Related
Oct 26, 2014
I have created TIFF Reader using libtiff in c++. Now I have many tiff files with old-style jpeg compression that has to be read/open using libtiff in c++.
I guess, as "old-style" JPEG compression is deprecated in TIFF, because it was never fully specified. And because of this under-specification, various vendors implemented it in different, incompatible ways. Support was dropped in favor for TIFF compression 7, JPEG.
Unfortunately,old TIFF files using this compression still exists.
View 5 Replies
View Related
Feb 16, 2013
I have an application that Opens files with different extensions for viewing purposes only. I use MFC with Multi-Document template.
When I go to Windows Explorer in Windows 7 and right-click on Libraries - Documents, and scroll down to New, Explorer shows multiple links for creating new files with these different extensions.
My application does not create New documents. It just opens them for viewing purposes. In fact, I have disabled the New portion of the mainframe window.
My code includes:
EnableShellOpen();
RegisterShellFileTypes(TRUE);
I am at a loss as to what portion of my code would have placed these links into Windows Explorer!
Is there any way to prevent them from being created in the first place?
View 4 Replies
View Related
Jan 15, 2013
Opening large files in c++. In my application, i am trying to save video as long as users have space in harddisk. What I am trying to do is when user is recording video i am trying to append the video data in to the file. The problem is that every time file size reach over 2GB my software crashes.
View 5 Replies
View Related
Feb 27, 2015
I am new to GUI programming, I am using mono winforms
using System.Windows.Forms;
using System.Drawing;
using System.IO;
[Code]...
I tried sw.WriteLine(this.to.Text); but that did not work
View 4 Replies
View Related
Apr 11, 2013
It is suppose to display the message "This Account ID does not exist" but why do I get "segmentation fault"??I was able to compile and run the program so it shouldn't be a problem of the compiler.
Code:
#include <stdio.h>#include <string.h>
struct Account {
char* Account_ID;
char* Account_Type;
char* AccountOwner_FirstName;
char* AccountOwner_LastName;
float* Balance;
[Code]....
View 11 Replies
View Related
Sep 16, 2014
This is the code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
[code]....
I am using Visual Studio 2013.i was writing my first code for Windows in C#.I had got everything all right but Visual studio keeps showing me the problem that The name 'contentGrid' does not exist in the current context.I have tried Everything I could think of.I recentered the app to Windows 8.1.
View 2 Replies
View Related
Sep 11, 2013
I was wondering how can we know how many items exist in a dialogbox? If there any way that i can get the items ID in a dialogbox by having just the dialogbox's object or handler? Or any way that we can get a dialogbox content by coding.
View 6 Replies
View Related
Jan 27, 2014
For the last part of this problem, if player 2 loses the game of hangman, I need to display the letters they did get right. In order to do that, I believe that I need to traverse vector v for the elements that exist in the string hiddenword, and then print those characters that match.
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int letterFill (char, string, string&);
[Code] ....
View 1 Replies
View Related
Sep 24, 2014
How to validate the data if the data already exist in the table record in c#?
For example I wanted to add the student roll no. if roll no. is 134 and if we are adding rollno. 134 student then we get the warning like roll no. 134 is already exist ....
View 1 Replies
View Related
Dec 5, 2014
I'm writing a class "Property" for a program that manages different types of properties. This is my .h for y base class. I was trying to write a virtual void function to convert different children classes to strings that can be displayed, but Xcode is freaking out.
I had it as:
virtual void toString()= 0;
and it gave me an error message: "Virtual can only exist in non-static member functions" and "field has incomplete type 'void'"
I changed it to:
virtual string toString() = 0;
and the error message didn't change.
Is this an issue with Xcode or did I do something wrong? Even after changing it to string it told me that it "has incomplete type 'void'"....
View 1 Replies
View Related
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
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
Sep 16, 2013
When including a header file in stdafx.h, should that file still be included in the source file where it is actually used?
If it is included in both places, is the one in the source file ignored?
View 5 Replies
View Related
Oct 11, 2014
Main console: qwer.exe
Secondary console: asdf.exe
System(c:asdf.exe);
I wanna open this asdf.exe new console. Not in the qwer.exe.
View 1 Replies
View Related
Apr 17, 2014
I am working with a program that provides some files. First i give as a argv[1] value the input file with the ending .inp After that the program provides a file with the ending .sta I need to cut the ending .inp from the inputfile at first and after that for a search in the .sta-file i want to open the input.sta file. I want to add the ending to the file.
ifstream file1("test_T.sta");
This test_T.sta is actually hardcoded, but i need something working like that:
ifstream file1(argv[1].sta); ????
Thus, at first cut the .inp ending and by the searchsequenz add the .sta ending.
View 2 Replies
View Related
Apr 15, 2013
I am wondering how can i open a .exe file with my c++ program. What is the source code?
View 6 Replies
View Related
Apr 21, 2013
I'm trying to type out whatever is in the .txt document, but I cannot open it for some reason. My code is
Code:
int main(int argc, char *argv[]) {
char ch=0;FILE *fp;
fp=fopen("C:UsersPCDesktopNew folderQuestion 5one.txt",'r');
while(ch!=EOF){
printf ("%c", ch);
ch=getc(fp);
Sleep (200);}fclose(fp);
return 0;
}
I keep getting an error with my fp=fopen so how do you open the text? Do i have anything else wrong with my code.
View 9 Replies
View Related
May 10, 2013
I have a batch of .pdf files (~1000) with names 001.pdf 002.pdf ...etc. Still pretty new to C, but would it be possible to write a program that would open a PDF, prompt a new name from user, and when entered, close the .pdf and open the next one in the list?
View 14 Replies
View Related
Jan 6, 2015
how can i minimize all open windows using c++ program? I want to call the minimize function at some places in my program... so write how the function structure can be made and how do i call it?
View 2 Replies
View Related
Feb 10, 2013
how to open a word document in c++?
View 4 Replies
View Related
Sep 7, 2013
I have this problem, then solve it by using the other kind of SDL.dll(eg. 32-bit instead of 64-bit). However, I get the error
The application was unable to start correctly (0xc00000be). Click OK to close the application.
no matter what SDL.dll I use. So far, the only solution does not work for me,
View 4 Replies
View Related
Apr 28, 2014
There is only one thing I need here. When the paint program is opened I need it to automatically open it maximized. Other than that my code works perfectly for what I'm trying to build.
It has to be maximized so when a friend opens it after I send it to him, it auto maximizes and doesn't start drawing on his desktop.
#include <iostream>
#include <Windows.h>
using namespace std;
int main() {
system("start C:/Windows/System32/mspaint.exe");
FreeConsole();
Sleep(1000);
[Code] .....
View 3 Replies
View Related
Oct 22, 2014
I am creating a console based application which needs to be dual tasking, which prompts me to share a single console for the GUI console based and inputs from the user.
I want to know if there is a mechanism through I can open more than one command prompt so that I would use efficiently both of them.
Furthermore, I would need also to know how to control on which to print and on which not to be printed.
Is there such a thing?
I am using Visual Studio 2012 Ultimate on a Windows 8.1 Professional PC.
View 1 Replies
View Related