LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-06-2004, 11:34 PM   #1
akaash
LQ Newbie
 
Registered: Mar 2004
Location: Gujarat, India
Posts: 22

Rep: Reputation: 15
problem with writing into a file using socket(perl)


We are having two servers(linux) : server1 and server2
I want to transfer contents of a file located on server1 to server2.

i m using IO::Socket module for this.

On server1 I have a cgi program sam.cgi having -rwsr-xr-x and owner is root and group is also root.

In this sam.cgi script we are creating the client part of the socket which reads data from a particular file and then transfers that data to server part of the socket which is running and listening on server2.

Data is transfered successfully and it is also printed on console (STDOUT) of server2. But the problem is that we are not able to write that collected data to some file on server2.

I don't know what's the problem?

The script on server2 which is listening the requests is having following rights
-rw-r----- temp1 temp1

where temp1 is the username.

i want to write the transfered data in file on server2: /home/temp1/backup.txt

what i should do?????
 
Old 04-07-2004, 11:18 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,198

Rep: Reputation: 76
the second script shouldbe executable too (chmod 0755). What error messages do u get in respect of the filehandle u open to write the file?
 
Old 04-07-2004, 09:39 PM   #3
akaash
LQ Newbie
 
Registered: Mar 2004
Location: Gujarat, India
Posts: 22

Original Poster
Rep: Reputation: 15
The file is opened but no error is returned when i try to write the file.

When I see the directory the file is created but it does not contain anything.
 
Old 04-08-2004, 06:06 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,198

Rep: Reputation: 76
could u post a snippet of code concerning the filehandle? i guess that would be useful.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in C--double writing to file zaichik Programming 7 08-20-2005 04:38 PM
socket binding and writing wahhie Programming 0 11-21-2004 08:38 PM
problem using socket in perl for linux enviornment hitesh29 Linux - Networking 0 04-08-2004 12:11 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
perl - writing a data structure to a file.. is it possible? paavaka Programming 4 07-14-2001 12:04 AM


All times are GMT -5. The time now is 02:51 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration