how to copy downloaded file into my source file folder (putty/unix)


 
Thread Tools Search this Thread
Top Forums Programming how to copy downloaded file into my source file folder (putty/unix)
# 1  
Old 11-16-2011
Question how to copy downloaded file into my source file folder (putty/unix)

I need to
"Ensure that when you download libchat.a from the VLE you have copied it to the same folder on ius as your source files. You then refer to the library (and the libraries it needs) with:
gcc -o outputfile sourcefile.c -L. -lchat -lsocket -lnsl"
But I have no idea what this means! (I don't even know what my "source files" are)
libchat.a is actually a zipped folder with two files in it: root() and chatlib.o (?!)

Also "You will need to include three libraries called stdio.h, string.h and chatlib.h.
You should do this by placing the following lines at the start of your program.
#include <s t d i o . h>
#include <s t r i n g . h>
#include ” c h a t l i b . h ”
The chatlib library provides the following functions that you will need for this
problem"
I have downloaded chatlib.h but I dont know how to make it work on UNIX/putty.
Smilie
Thank you in advance!
# 2  
Old 11-16-2011
PUTTY isn't a UNIX the same way a TV isn't channel 3. Don't mistake the picture for the computer. PUTTY is a terminal emulator used to communicate with other systems over the internet, many of them UNIX systems, some of them not.

If you don't know what your system is, try running 'uname'.

Put the 'chatlib.h' file in the same folder as your .c files on the server. Your program will be able to find it with #include that way.

gcc -o outputfile sourcefile.c -L. -lchat -lsocket -lnsl
This is what you need to do in order to turn the code sourcefile.c into the program outputfile. Once you've compiled it this way, you can run it with ./outputfile

---------- Post updated at 12:09 PM ---------- Previous update was at 12:07 PM ----------

As for how to copy it into your folder, depends on how they have it set up. They probably have given you instructions on how to do so. FTP or SCP may be involved.

Worst case, you can run this in the putty window:

Code:
cat <<EOF > chatlib.h
paste the contents of chatlib.h into the window here
EOF

which will create chatlib.h with the pasted contents.
# 3  
Old 11-16-2011
Homework goes here, with special rules
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy specific file (different but same name) as folder name

I have to copy a particular file present in a main folder having part of the file-name present in many sub-folders to a new destination preserving the name of the source "part of the main folder" and previous file-name of the output file: Example: From /005_0/1000/005.xxx ->... (7 Replies)
Discussion started by: wappor
7 Replies

2. Shell Programming and Scripting

Copy one file from a server to a local folder

Hi, Is there a way I can copy a file from a server to a local folder (i.e. My Documents)? can it be done by scp? I tried this but it just rename the file as the folder it has to be transferred at. scp -r name@some_server:/home/user/file.txt 'somehere\home\home_dir' Thanks. (4 Replies)
Discussion started by: erin00
4 Replies

3. Shell Programming and Scripting

Need help in writitng a script to rename file name and copy to other folder

Hi All, My requirement is as follows: A file (say abc) will be having list of the .txt file names. I need to read this abc file line by line and rename the .txt file names inside it and move them to other folder/path. Eg: abc ------- file1.txt file2.txt file3.txt Output (should... (1 Reply)
Discussion started by: pavan.yadalla
1 Replies

4. UNIX for Dummies Questions & Answers

copy files grabbing destination folder from file name

Hi all... Below is what I am trying to do: 1. Having the following folder with the files... /source_folder/dodiddone.tar.gz /source_folder/gowentgone.tar.gz /source_folder/gowentgone.log 2. I need to copy and chown files with extension .tar.gz to another folder copy... (1 Reply)
Discussion started by: pedroz
1 Replies

5. UNIX and Linux Applications

Need to copy the latest file from Unix server to Shared folder

Hi All, One job in unix server will generate .csv files daily. I need to copy the latest of these .csv file from the unix server to the shared drive/folder in windows through unix script. My shared folder will look something like W:\some folder(for example). Could any one of you please help... (3 Replies)
Discussion started by: jaya@123
3 Replies

6. UNIX for Dummies Questions & Answers

Copy the latest (last file) in given folder

#!/bin/bash for i in {1..1536..1} do #find /home/test/Desktop/up111/workplace/Malware/$i/logs for a in /home/test/Desktop/up111/workplace/Malware/$i/logs/* do #max=a for b in /home/test/Desktop/up111/workplace/Malware/$i/logs/* do ... (4 Replies)
Discussion started by: upvan111
4 Replies

7. UNIX for Dummies Questions & Answers

Copy the latest file from a folder

Hi, I have a problem. I have some text files in a folder. The names can be like: emp_20080307053015.dat emp_20080306053015.dat emp_20080305053015.dat emp_20080304053015.dat The date format appended is like yyyymmdd and timestamp. What i need is i have to copy the latest file every... (3 Replies)
Discussion started by: Aswarth
3 Replies

8. Shell Programming and Scripting

How to copy file and locate in new folder?

Hi All, Please advise me how to make a copy of file from a list and store in one particular location? For example , I have aaa.txt which contains as below, But, those *usg files might be randomly store in different location.... > cat aaa.txt adc.usg dfdjkf.usg ugjfk.usg And I want... (3 Replies)
Discussion started by: cedrichiu
3 Replies

9. UNIX for Dummies Questions & Answers

ftp copy: preserve source file date stamp

Is there any way to preserve a file's create/mod date stamp when it is "put" via ftp (or even using Fetch) to a Win2K server and a SunOS 5.8 server? For example, if I copy a file with a create/mod date of "01/15/2005 3:36 PM" to my Win2K or SunOS ftp server, the date stamp will change to the... (5 Replies)
Discussion started by: cassj
5 Replies

10. UNIX for Dummies Questions & Answers

open a picture file in unix (putty)

hi i'm logged on to my schools unix machine via putty. how do i open/view a jpg picture file that is there on my root catalog? (2 Replies)
Discussion started by: javatutor
2 Replies
Login or Register to Ask a Question