473,699 Members | 2,329 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 3754
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
1544
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
6756
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
8268
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
2652
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
1289
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
4550
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
3663
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
2338
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
2623
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
9181
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9040
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...
1
8924
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8889
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
5877
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();...
0
4378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3060
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
2353
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2012
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.