473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How to write to a ".txt" file present on remote machine?

shrek123
How to write to a ".txt" file present on remote machine.

I dont want to use two way socket connection. Is there any other way to write to a file on remote machine?

Best Regards,
Shrek.
Sep 3 '07 #1
9 3744
Hey I got the way........
Here is the code:

Expand|Select|Wrap|Line Numbers
  1. $remote= '\\\remotehost\remotedir\remotefile.txt';
  2. open(fp, ">$remote") or die ("could not open the file");
  3.  
  4. print fp "PAUSE";
  5.  
  6. close(fp);
  7.  
  8.  
Sep 3 '07 #2
numberwhun
3,509 Expert Mod 2GB
Nicely done. Thanks for letting us know.

Regards,

Jeff
Sep 3 '07 #3
KevinADC
4,059 Expert 2GB
I'm surprised that works.
Sep 3 '07 #4
numberwhun
3,509 Expert Mod 2GB
If it does, so be it. At least they found something that works for them. :-)

Jeff
Sep 3 '07 #5
I'm surprised that works.
Hey KevinADC,

its working for me.....
Can you please let me know, does the above code hamper the performance of the complete script??
Sep 4 '07 #6
KevinADC
4,059 Expert 2GB
As far as I know there is no efficiency or performance issue with the code you posted. I was just surprised it worked. Writing to files on remote machines is generally not done using the open() function. There must be something else that is allowing your perl script to access the remote machine/file and write to it. Or maybe I am just totally confused.
Sep 4 '07 #7
numberwhun
3,509 Expert Mod 2GB
I would think that, even in the Windows environment, he would have to have the drive mapped and have access. If he does, it seems logical to be able to access a mapped drive. That is what it looks like he is doing.

Regards,

Jeff
Sep 4 '07 #8
KevinADC
4,059 Expert 2GB
I think you're right.
Sep 4 '07 #9
Kelicula
176 Expert 100+
Must be, I tried it from my PC to my host, and it was
access denied baby. But it did try, and it worked in that much.
Sep 5 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: bettina | last post by:
I don't if that's possible... that's why I ask. In my homepage www.coaster.ch I show photos from beercoasters with their respective codes. At present, those who want to exchange with me, have to...
1
by: Magnus | last post by:
allrite folks, got some questions here... 1) LAY-OUT OF REPORTS How is it possible to fundamentaly change the lay-out/form of a report in access? I dont really know it that "difficult", but...
8
by: Juan Manuel Alegría B. | last post by:
Hi group!!! I am new in the ASP.NET programming. I am trying to open a ..txt file but I can't do it. I am using: but i don't know if its the right way. Thanks for help me. Dim proc As New...
1
by: snsit1 | last post by:
Hello - i am wondering if anyone can help, I am fairly new to javascript / html and am having difficulty getting selected options ticked using check boxes out to a .txt file and have another script...
0
by: james.benson1 | last post by:
Hello All, I am trying to create a DTS package. I have two tables tbl_A and tbl_B with similar data/rows but no primary keys. tbl_A is master. I would like this package to query tbl_A and...
7
by: jb1 | last post by:
Hello All, I am trying to create a DTS package. I have two tables tbl_A and tbl_B with similar data/rows but no primary keys. tbl_A is master. I would like this package to query tbl_A and...
5
by: shantanu | last post by:
Hi i am trying to upload a txt file thru this code, but its not updating the data. is this code fine. Or can anybody please suggest me some other meathod to do the same. its urgent please help ...
5
by: John Nagle | last post by:
Python's "robots.txt" file parser may be misinterpreting a special case. Given a robots.txt file like this: User-agent: * Disallow: // Disallow: /account/registration Disallow: /account/mypro...
2
by: John Nagle | last post by:
For some reason, Python's parser for "robots.txt" files doesn't like Wikipedia's "robots.txt" file: False The Wikipedia robots.txt file passes robots.txt validation, and it doesn't disallow...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.