Super Contributor.. Chuck Perilli Super Contributor..
Super Contributor..
507 views

Using "Write to File" operation with Linux

Jump to solution

This "cross platform" operation includes this example in description:

2. This is a valid input example for using this operation on Linux:
source: /root/example.txt
contents: line1,line2,line3
delimiter: ,

That is exactly the form I'm using.  My source path is "/home/25153/hpootst.txt".   I first log in to target server and then attempt to write to file.  I get this:

\home\25153\ootest.txt (The system cannot find the path specified)

It appears "/" is being changed to "\".  

Any thoughts on this? Thanks.

-Chuck

 

 

 

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: Using "Write to File" operation with Linux

Jump to solution

Hi,

The operation does not have a host parameter in order to work remotely, therefore it will only work on the localhost of the worker. As such if you run it from studio it will try to look on the local file system for the path "/home/25153/hpootst.txt" and (since it is windows) it wil never find it.  If you were to run it from central (or remote debug it to central) with a worker on the remote linux server, as long as it executes on that worker and the path "/home/25153" exists it will work. 

Keep in mind that the write to file operation will create files if they do not exist, however it will not create underlying floders in order to make the path exist.

Hope this helps,

Vlad

0 Likes
3 Replies
seppler Respected Contributor.
Respected Contributor.

Re: Using "Write to File" operation with Linux

Jump to solution

It's hard to tell without the full debug log from OO, however, one thing that sticks out to me that I need clarification on, the filename in your 'sourcepath' and the filename in the error message are not the same ('hpootst.txt' vs 'ootest.txt').  Is this typo/copy-paste error or is that what's actually happening?  If so, is your variable being overwritten somewhere causing it to have the wrong filename?

-Scott Eppler · Cloud Engineer · Coda Global
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Using "Write to File" operation with Linux

Jump to solution

Hi,

The operation does not have a host parameter in order to work remotely, therefore it will only work on the localhost of the worker. As such if you run it from studio it will try to look on the local file system for the path "/home/25153/hpootst.txt" and (since it is windows) it wil never find it.  If you were to run it from central (or remote debug it to central) with a worker on the remote linux server, as long as it executes on that worker and the path "/home/25153" exists it will work. 

Keep in mind that the write to file operation will create files if they do not exist, however it will not create underlying floders in order to make the path exist.

Hope this helps,

Vlad

0 Likes
Super Contributor.. Chuck Perilli Super Contributor..
Super Contributor..

Re: Using "Write to File" operation with Linux

Jump to solution

That explains the problem.  Would be nice if the operation allowed a host parameter.  Thanks for quick reply.

-Chuck

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.