Hi friends, my problem is only about file operations. When i type any file operation code, it doesn't create any text file or doesn't edit that i created manually text files...
I searched on web and i tried all solutions but they didn't effect. One of solutions is gave me an error but I didn't look to what was it(it was something like library error)
Between i sent my codes to friends but they worked on their PCs...
Also i am using Dev C++.(tried visual studio too for solve this problem but this didn't change anything for me)
Here is my (creating and) adding to text file function;
Running this program the first time successfully creates a file, when I entered "hello" as my nickname.
Running the program the second time successfully then continues appending onto the file.
I created a new source code with above codes on Dev C++(also opened it as administrator) on my D disc and I give all rights to all users to which folder i save it for be sure. "Ide or compiler didn't give me any error" but "the codes didn't create a text file."
Good suggestion. Assuming Windows, you can add system("cd"); to your program to print your current working directory. Just as a quick check for debugging.
(On *nix this is system("pwd");)
I don't know then. The only thing that is odd to me in that picture is that there is a '0' before your "Enter your nickname" text, which suggests that you're running code that doesn't match the above code.
I copied and pasted the last codes from my program already so they must be same. Also the you said quick check but it took about one minute, i don't know is that normal because normally it works after a few seconds.
And the output;
D:\TEST
0Enter your nickname: ali
failure
The user is succesfully added!
Hi it's me again, i don't know why but "thorunkilici" can't reply or creates new topic. I guess because of i tried to paste imgur link again for show inside of the TEST folder.
There are only two files still, deneme.cpp and deneme.exe . So I can't see still...
If you open cmd, then cd to D:\TEST, and then do dir, does the file show up in the list?
- If it does, that means it's indeed a display issue with your file explorer
- If it does not show up, it means something else is deleting your file
Okay so now my hypothesis is that something else is deleting your users.txt file without your knowledge.
First, temporarily turn off any anti-virus/anti-malware you have, then re-run the program.
If the problem is still happening, you'll have to try some deeper troubleshooting.
There is a program called procmon by sysinternals (owned by Microsoft) that can monitor a variety of events that processes on your computer are doing. https://docs.microsoft.com/en-us/sysinternals/downloads/procmon