Remove a file starting with special character - centos7

How to delete such "?file.php"
When I try to delete this file or the directory containing this file, arises an error "cannot remove input / output error" appears
"?file.php"

Related

Change directory from ROOT (C++)

I want to change the directory of ROOT to analyse a dataset in a certain project file. ROOT is stored here "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ROOT 6.16.00". The data in the project file I want to access are in "C:\Users\aaa\Desktop\Project". How can I change the directory?
I have tried:
gSystem->cd("C:\Users\aaa\Desktop\Project");
but this does not work. The error which appeared was
\U used with no following hex digits
" use of undeclared identifier 'cd' "

Informatica Source File Name with Special Character like 'ä'

I am having a problem with my source file name when loading a source from list file. My file is named: "Bär.csv" but when executing, this error occurs. It can't find my file as it was changed to "Bör.csv". Is there a way for the reader to read special characters in the file name?
Error opening file [C:\Informatica\10.2.0\server\infa_shared\SrcFiles\Inbound\test\Bör.csv]. Operating system error message [The system cannot find the file specified.].
You have to configure your integration service to use Unicode.

Cannot write to a folder within the exectuable's current directory

I have a program that I'm attempting to write various files to. In an attempt to clean it up I would like to put these files into a directory. My program is running in a directory different from the sln for VS 2012 i.e. the exe is the only part of the VS files in the directory. If I simply print the files, it's fine but if I attempt to print those same files to a different directory, then it doesn't do anything. I printed out the directory that I'm attempting to access and I'm getting "000000" as a response. code looks like:
std::ofstream output
output.open("\myFiles\entityOutput.csv", std::ios::app);
output << "print some stuff here" << std::endl;
I'm sure it's something simple but I haven't been able to figure out what. Tried "\\myFiles....." already "/myFiles" etc. I'm on a Windows 7 system as well.
That's because, while opening a file, you need to swap \ with either \\ or /. The reason is that \ character is considered as a special one that's used for example to represent end of line character (\n).
Just swap output.open("\myFiles\entityOutput.csv", std::ios::app);
to output.open("/myFiles/entityOutput.csv", std::ios::app);,
however make sure that the path is also correct!
Usually it's a good programming practice to check whether or not a file opening succeeded at first.

fstream file opening start piont

I am opening file with full path
fin.open(C:/Users/User/Desktop/MyFiles/File/file.txt);
and without
fin.open(../File/file.txt);
And both works fine :
Does that mean that C:/Users/User/Desktop/MyFiles is useless and in both ways fstream starts opening file from /File/ folder ??:
And if it is right how can I force it to start from C:/..?.(because sometimes it could not open with full path).

I am having trouble opening a .txt file in my C++ program

I have put it under the Source Files folder. I have set my working directory to $(SolutionDir)$(Configuration)\ (im not sure if that is right, i saw it somewhere) could someone help me troubleshoot.
int main()
{
cout << "program running" <<endl;
pair<int, unsigned int> mypair;
ifstream myfile;
myfile.open("numbers.txt", ios::in);
if (!myfile.is_open()){
cerr << "can't open input file" << endl;
}
else
{
cout << "file opened" << endl;
}
getchar();
myfile.close();
}
...output is: can't open input file
To figure out what directory you're pointing to, try to create a new file instead of opening one:
std::ofstream("out_test.txt");
Then you can find that file searching with File Explorer into the solution dir.
There is such thing as current directory for an application. When you run an app from VS working directory would be current one.
If you specify file name with relative path (or no path at all) OS will try to find that file relative to that directory. Where executable file and especially source file(s) are located completely irrelevant. So solution could be either set working directory to where numbers.txt is located (or move nubers.txt there), or use relative path something like foobar/numbers.txt or even ../foobar/numbers.txt etc or use absolute path.
okay I managed to figure it out..with help :) I did what Paulo M said :
To figure out what directory you're pointing to, try to create a new file instead of opening one:
std::ofstream("out_test.txt");
Then you can find that file searching with File Explorer into the solution dir.
After I figured out where the file got sent I added a new file w/ some integers to that dir and made sure the working directory was the same.I'm not sure if i had to change it? (can files be sent elsewhere?).
I had tried to do this before but I was not able to move my txt file into this directory by copy paste..so gave up. But anyhow I just right clicked/new text document/ and edited the doc with some numbers. then changed my program to open this new document.
saving file directly to the directory also worked. :) :) :)
but i am curious why I couldn't just paste it there?