0

I need to copy a .csv(Comma Separated Values) file from my desktop (running macOS) to an SSH server. I've tried using the scp command, but I keep getting an error saying /Users/jbalkovec/Downloads/WHO-COVID-data.csv: No such file or directory which is strange since all I did was option clicked the file and copied the path.

This is the command I am running in the terminal:

scp /Users/jbalkovec/Desktop/WHO-COVID-data.csv jbalkovec@cs1.seattleu.edu:/home/st/jbalkovec/2430CPSC/Projects/A4/

What am I doing wrong? Are there any other methods I could use to transfer the file?

I tried just dragging it from my desktop to the VS Code editor but unfortunately when I try to open it says Unauthorized. When I run the command it asks for my password (since it the University's server) but then it throws an error No such file or directory which I am assuming means that bash couldn't find the file right?

I don't really know what tags to put under here, so please don't get mad if some of them are wrong. Thank you.

  • 3
    `std::cout` is usually buffered. Its buffer is likely not being flushed to the terminal until after `usleep()` is called. You can use `std::cout << std::flush` before calling `usleep()` to ensure the buffer is flushed. Note, `std::endl` performs a `flush` after writing `\n`. – Remy Lebeau Apr 26 '23 at 01:53
  • Thank you, that worked. Could you please give me a very basic and brief explanation on why that happens? – underloaded_operator Apr 26 '23 at 01:58
  • 2
    Is there something about "*`cout` is buffered*" that you don't understand? `cout` has an internal buffer which data is first written to. Typically, that buffer is not flushed to the output device (ie the terminal) until either 1) a `\n` character is written, 2) the buffer fills up, or 3) `cout.flush()` is called. – Remy Lebeau Apr 26 '23 at 01:59
  • 1
    Then you are in the wrong school, they are not doing their job to teach you, because this is one of C++'s fundamentals. This should have been covered in the very first class that introduced `cout`. In any case, have a look at [this `cout` reference](https://en.cppreference.com/w/cpp/io/cout), and in particular read up about [`std::basic_ostream`](https://en.cppreference.com/w/cpp/io/basic_ostream) and [`basic_ostream::flush()`](https://en.cppreference.com/w/cpp/io/basic_ostream/flush), and [`std::basic_streambuf`](https://en.cppreference.com/w/cpp/io/basic_streambuf) which is the actual buffer – Remy Lebeau Apr 26 '23 at 02:05
  • I don't think I phrased that correctly, by fundamentals I meant stuff like heaps, BSTs, Priority Queues, Dynamic memory, Searching Algorithms...For other stuff such as enums, structs, STL,... They expect you to learn it all by yourself. That's how SeattleU works – underloaded_operator Apr 26 '23 at 02:13
  • 1
    "*by fundamentals I meant stuff like ...*" - Those are not "fundamentals" to C++. Those are quite advanced topics, actually. But, if that school doesn't even offer a basics course before those other courses, well then you didn't meet their prerequisites properly to begin with. Oh well. Go get yourself some [decent C++ books](https://stackoverflow.com/questions/388242/) to learn from. – Remy Lebeau Apr 26 '23 at 02:19

0 Answers0