How to send file via C++ - c++

I would like to ask how it could be possible to transfer a simple .csv file from one PC to another using C++.
I'm quite of new to C++, so please be patient with me ;-)
At the moment i've got a C++ program collecting data from two COM-ports and storing it (after editing) into the .csv-file mentioned above. Before windows (7 professional) is shutting down i would like to start a program which takes this file and send it to me or my webserver.
I googled around and found many postings showing FTP- or mail-scripts, but none of them worked for me...
I would prefer a FTP-solution.
Does anybody know how to realize a task like this?
I would be very greateful for any help :-)

Related

How to track the number of times my console application in C++14 has been launched?

I'm building a barebones Notepad-styled project (console-based, does not have a GUI as of now) and I'd like to track, display (and later use it in some ways) the number of times the console application has been launched. I don't know if this helps, but I'm building my console application on Windows 10, but I'd like it to run on Windows 7+ as well as on Linux distros such as Ubuntu and the like.
I prefer not storing the details in a file and then subsequently reading from it to maintain count. Please suggest a way or any other resource that details how to do this.
I'd put a strikethrough on my quote above, but SO doesn't have it apparently.
Note that this is my first time building such a project so I may not be familiar with advanced stuff... So, when you're answering please try to explain as is required for a not-so-experienced software developer.
Thanks & Have a great one!
Edit: It seems that the general advice is to use text files to protect portability and to account for the fact that if down-the-line, I need to store some extra info, the text file will come in super handy. In light of this, I'll focus my efforts on the text file.
Thanks to all for keeping my efforts from de-railing!
I prefer not storing the details in a file
In the comments, you wrote that the reason is security and you consider using a file as "over-kill" in this case.
Security can be solved easily - just encrypt the file. You can use a library like this to get it done.
In addition, since you are writing and reading to/from the file only once each time the application is opened/closed, and the file should take only small number of bytes to store such data, I think it's the right, portable solution.
If you still don't want to use a file, you can use windows registry to store the data, but this solution is not portable

C++ Terminal-Output not one after another

I'm sorry if this question sounds a little childish, but I'm very new to C++ and console applications.
I recently wrote a HTTP1.1-Client to down/upload files. Everything works fine. The Problem is that there are quite a lot of logs to be output on the terminal and there is also the content of the remote host that should be print to the terminal. At the end of the application some of the output is not well formed - sometimes the order ist not right and sometimes the messages are just broken apart.
The application does not use multithreading and uses the libraries SPDLOG and FMT::FORMAT to output the data. The code is way to big to be put in here but if you'd anyway like to see it i can as well post it here.
I'd be thankful for every suggestion about what I might have done wrong and what the problem might be. Thanks!

Are there known issues with QFtp for use with pure-ftpd?

This is related to the question I posted here, but I hadn't gotten much visibility for that question so I wanted to ask in a more general way. I have a Qt 4.7 project that utilizes QFtp functionality. Until very recently we were using this with an FTP server that was vsftpd. Everything worked fine with it then. However, several days ago we moved the server to a new computer. All the contents are identical, but now it uses pure-ftpd instead of vsftpd. Since the move, none of my QFtp code works properly. Is there any known problems that arise when trying to use QFtp with this type of FTP server? I can't find anything helpful online, and it's rather frustrating not being able to find anything wrong with the code and yet having it not work. If anyone knows anything about this and could please share, I'd appreciate it a lot. Thanks!
So I think I just figured something out... I had it run QFtp::list to go through the ftp and retrieve directories, then use list() again on those to retrieve the files in those subdirectories. Our subdirectories to get files out of had spaces in the name, eg "My Directory". Apparently, the vsftpd we were using before could handle this with no problem, but the pure-ftpd can't handle spaces in the directory names. When I switch it to something like "MyDirectory" or "My_Directory", the pure-ftpd works fine. I couldn't find anything online about this difference, but apparently it's there, because that fixed the issue I was having.

Auto download file from FTP and check against existing file

I have an internal company need to create some sort of application which does the following daily at a specific time:
connects to our company's internal ftp url (not a secure url)
downloads a file with a specific file name
checks the newly downloaded file with the file downloaded the day before
throws an error if the file is the same or else displays a message saying all is good (or sends an email or something with that notification)
That's it. All i need to do is to check and make sure the file on the ftp is different from the day before.
Can anyone recommend an easy way of doing this? I've tried googling for a solution and not quite finding a straight answer.
I've been out of programming for the last 8 years but I still remember visual basic 6.0 and visual c++.
Please guide / suggest as you see fit.
Thank you :)
For vc++:
You could use any ftp client library for downloading a file. Take a look at this SO question which could be useful to you C++ FTP Library? . Then you need a proper way to chech the time. I think your program might need to run at statup and check for the system time at a specific interval if the time is due then download the file. For this you can take alook at this question How to get current time and date in C++? . Finally there are numerous ways for comparing the file and outputing the result, for starters is suggest you use the std.

How to read a .shd file in C++?

I am creating a project in c++ for getting JobSettings of a job in a queue from .shd file.Can anyone please suggest me which API is used for reading .shd file?
If you're talking about the shadow file from the Windows spooler, take a look at this site and code accordingly - http://www.undocprint.org/formats/winspool/shd
Please note that this format is undocumented and so could change ever so often.