473,725 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

shrek123
23 New Member
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 3757
shrek123
23 New Member
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 Recognized Expert Moderator Specialist
Nicely done. Thanks for letting us know.

Regards,

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

Jeff
Sep 3 '07 #5
shrek123
23 New Member
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 Recognized Expert Specialist
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 Recognized Expert Moderator Specialist
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 Recognized Expert Specialist
I think you're right.
Sep 4 '07 #9
Kelicula
176 Recognized Expert New Member
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
1546
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 write the codes in a mail. I want to make it possible that other collectors can select the coasters (by clicking on it, for example) and something like a txt file with the codes of the selected coasters will be generated and then sent to me... as...
1
6760
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 listen up; Reports, the way I look at them, all present data downwards, in this way; TITLE data
8
8272
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 System.Diagnostics.Process proc.Start(file:///C:/bitacora.txt)
1
2655
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 called once the output is placed in to the .txt file. What i am attempting to do is have the user select the options for switches they wish to perform backups on and click submit - have this written out to a .txt file which i will then need to use as...
0
1291
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 tbl_B and find 1)all rows in tbl_A that are different in tbl_B, 2)all rows in tbl_A that are not present in tbl_B and
7
4551
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 tbl_B and find 1)all rows in tbl_A that are different in tbl_B, 2)all rows in tbl_A that are not present in tbl_B and
5
3666
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 regards shantanu
5
2339
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 Disallow: /account/myint ...
2
2624
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 unknown browsers. But the Python parser doesn't see it that way. No matter what user agent or URL is specified; for that robots.txt file, the only answer is "False". It's failing in Python 2.4 on Windows and 2.5 on Fedora Core.
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.