Create an output file using Perl

------_=_NextPart_001_01C24DF9.6C83FD20
Content-Type: text/plain;
	charset="iso-8859-1"


 i want to generate an output file using perl

 open (OFILE, " > /tmp/aa.lst") or die "Can't write $p_OutputFile: $! ";

 Everytime I ran it, I got the following error message.

 Can't write /tmp/aa.lst: No such file or directory  at compare.pl line 71.


Any suggestions?

Thanks,
Allen
 

------_=_NextPart_001_01C24DF9.6C83FD20--
0
allen
8/27/2002 6:41:58 PM
perl.beginners.cgi 3839 articles. 0 followers. Follow

6 Replies
533 Views

Similar Articles

[PageSpeed] 11
Get it on Google Play
Get it on Apple App Store

Does the /tmp directory exist? does the user running this script have
write permissions to that directory?

--- Allen Wang <allen.wang@quest.com> wrote:
> 
>  i want to generate an output file using perl
> 
>  open (OFILE, " > /tmp/aa.lst") or die "Can't write $p_OutputFile:
> $! ";
> 
>  Everytime I ran it, I got the following error message.
> 
>  Can't write /tmp/aa.lst: No such file or directory  at compare.pl
> line 71.
> 
> 
> Any suggestions?
> 
> Thanks,
> Allen
>  
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
0
jraube
8/27/2002 6:46:40 PM
------_=_NextPart_001_01C24DFA.88870CF0
Content-Type: text/plain;
	charset="iso-8859-1"

Yes, we do have "/tmp" diretory and everyone has write permission to "/tmp"

Thanks,
allen

-----Original Message-----
From: Joe Raube [mailto:jraube@yahoo.com]
Sent: Tuesday, August 27, 2002 11:47 AM
To: beginners-cgi@perl.org
Subject: Re: Create an output file using Perl


Does the /tmp directory exist? does the user running this script have
write permissions to that directory?

--- Allen Wang <allen.wang@quest.com> wrote:
> 
>  i want to generate an output file using perl
> 
>  open (OFILE, " > /tmp/aa.lst") or die "Can't write $p_OutputFile:
> $! ";
> 
>  Everytime I ran it, I got the following error message.
> 
>  Can't write /tmp/aa.lst: No such file or directory  at compare.pl
> line 71.
> 
> 
> Any suggestions?
> 
> Thanks,
> Allen
>  
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

-- 
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org

------_=_NextPart_001_01C24DFA.88870CF0--
0
allen
8/27/2002 6:49:54 PM
------_=_NextPart_001_01C24E08.33BB6820
Content-Type: text/plain;
	charset="iso-8859-1"


I think there should not be any spaces between " and >, and that's the
reason why it failed.

Thanks anyway.


open (OFILE, " > /tmp/aa.lst") or die "Can't write $p_OutputFile:


-----Original Message-----
From: Allen Wang [mailto:allen.wang@quest.com]
Sent: Tuesday, August 27, 2002 11:50 AM
To: 'Joe Raube'; beginners-cgi@perl.org
Subject: RE: Create an output file using Perl


Yes, we do have "/tmp" diretory and everyone has write permission to "/tmp"

Thanks,
allen

-----Original Message-----
From: Joe Raube [mailto:jraube@yahoo.com]
Sent: Tuesday, August 27, 2002 11:47 AM
To: beginners-cgi@perl.org
Subject: Re: Create an output file using Perl


Does the /tmp directory exist? does the user running this script have
write permissions to that directory?

--- Allen Wang <allen.wang@quest.com> wrote:
> 
>  i want to generate an output file using perl
> 
>  open (OFILE, " > /tmp/aa.lst") or die "Can't write $p_OutputFile:
> $! ";
> 
>  Everytime I ran it, I got the following error message.
> 
>  Can't write /tmp/aa.lst: No such file or directory  at compare.pl
> line 71.
> 
> 
> Any suggestions?
> 
> Thanks,
> Allen
>  
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

-- 
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org

------_=_NextPart_001_01C24E08.33BB6820--
0
allen
8/27/2002 8:27:45 PM
does the file aa.lst already exists in /tmp? if so, does your script
have permission to write to it? the error doesn't seem like a permission
problem...

david

On Tue, 2002-08-27 at 11:49, Allen Wang wrote:
> Yes, we do have "/tmp" diretory and everyone has write permission to
> "/tmp"
> 
> Thanks,
> allen
> 
> -----Original Message-----
> From: Joe Raube [mailto:jraube@yahoo.com]
> Sent: Tuesday, August 27, 2002 11:47 AM
> To: beginners-cgi@perl.org
> Subject: Re: Create an output file using Perl
> 
> 
> Does the /tmp directory exist? does the user running this script have
> write permissions to that directory?
> 
> --- Allen Wang <allen.wang@quest.com> wrote:
> > 
> >  i want to generate an output file using perl
> > 
> >  open (OFILE, " > /tmp/aa.lst") or die "Can't write $p_OutputFile:
> > $! ";
> > 
> >  Everytime I ran it, I got the following error message.
> > 
> >  Can't write /tmp/aa.lst: No such file or directory  at compare.pl
> > line 71.
> > 
> > 
> > Any suggestions?
> > 
> > Thanks,
> > Allen
> >  
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
> For additional commands, e-mail: beginners-cgi-help@perl.org


0
dzhuo
8/27/2002 9:51:07 PM

try using:
open (OFILE, " +> /tmp/aa.lst") or die "Can't write $p_OutputFile: $! ";




if that is still making problems, then visit:
http://www.perldoc.com/perl5.6.1/pod/func/open.html

   ->  "... '+>' mode would clobber the file first."




cheers,
 Alex                            mailto:Keex@gmx.de




 

> does the file aa.lst already exists in /tmp? if so, does your script
> have permission to write to it? the error doesn't seem like a permission
> problem...

> david

> On Tue, 2002-08-27 at 11:49, Allen Wang wrote:
>> Yes, we do have "/tmp" diretory and everyone has write permission to
>> "/tmp"
>> 
>> Thanks,
>> allen
>> 
>> -----Original Message-----
>> From: Joe Raube [mailto:jraube@yahoo.com]
>> Sent: Tuesday, August 27, 2002 11:47 AM
>> To: beginners-cgi@perl.org
>> Subject: Re: Create an output file using Perl
>> 
>> 
>> Does the /tmp directory exist? does the user running this script have
>> write permissions to that directory?
>> 
>> --- Allen Wang <allen.wang@quest.com> wrote:
>> > 
>> >  i want to generate an output file using perl
>> > 
>> >  open (OFILE, " > /tmp/aa.lst") or die "Can't write $p_OutputFile:
>> > $! ";
>> > 
>> >  Everytime I ran it, I got the following error message.
>> > 
>> >  Can't write /tmp/aa.lst: No such file or directory  at compare.pl
>> > line 71.
>> > 
>> > 
>> > Any suggestions?
>> > 
>> > Thanks,
>> > Allen
>> >  
>> > 
>> 
>> 
>> __________________________________________________
>> Do You Yahoo!?
>> Yahoo! Finance - Get real-time stock quotes
>> http://finance.yahoo.com
>> 
>> -- 
>> To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
>> For additional commands, e-mail: beginners-cgi-help@perl.org

0
Keex
8/28/2002 6:07:09 AM
Alex B. <Keex@gmx.de> wrote:
....
>>> --- Allen Wang <allen.wang@quest.com> wrote:
>>> > 
>>> > i want to generate an output file using perl
>>> > 
>>> > open (OFILE, " > /tmp/aa.lst") 
>>> >     or die "Can't write $p_OutputFile: $! ";
>>> > 
>>> > Everytime I ran it, I got the following error message.
>>> > 
>>> > Can't write /tmp/aa.lst: No such file or directory  at compare.pl
>>> > line 71.
....
> 
> try using:
> open (OFILE, " +> /tmp/aa.lst") or die "Can't write $p_OutputFile: $! ";
                ^

You're allowed to put whitespace in between the mode 
and filename, but you can't put any before the mode.

These snippets are equivalent to

  open OFILE, '<', ' +> /tmp/aa.lst'
                    ^^^^^^^^^^^^^^^ filename
               ^ mode

So just remove the leading space, or use the 3 argument form.

  open OFILE, '> /tmp/aa.lst'
  open OFILE, '>', '/tmp/aa.lst' 

-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m("(.*)")'
0
s_grazzini
8/28/2002 12:54:12 PM
Reply:

Similar Artilces:

How to create a chart using these files (Orig. Est,Current Est,Hours How to create a chart using these files (Orig. Est,Current Est,HoursWorked,Hours Left,%Complete,Gain,Deadline) of bug.
Hi, How to create a chart using these files (Orig. Est,Current Est,Hours Worked,Hours Left,%Complete,Gain,Deadline) of bug. Here I am having a custom field called Sprint. Values are Sprint 1, Sprint 2 and Etc. Sprint value for ten bugs is Sprint 1. Here Can you help me, How to create a Burn down chart for Bugs having Sprint 1 is the value of Sprint custom field. Thanks. Regards, Navanethanmca@gmail.com ...

Error Message F2039 Could not create output file (output file name)
First, thank you in advance for any help you might be able to provide. I made a few changes to my application, i.e., added several units from an older version, and got the above error message when I attempted to execute it. Even after I went through and removed the recently added on units, I am still getting the error message and termination. What do I have to do to clean this up? I cannot see where something changed that I did not undo from removing the recently added-on, troublesome units. Once again, thank you very much. John Shyer I am using Delphi XE on Windows 7. John Sh...

Create web setup file,in project output there is only "Content files" no "Primary outputs"
 Create web setup file,in project output there is only "Content files" no "Primary outputs".net bother Primary output is required in windows application, it's not required in web application. Web application need only bin folder and .aspx forms. Web setup is only for web application so if you will select content files then it will make setup which contains necessary folders (bin, app_code, etc) and .aspx pages. You don't need to add primary output.---------------------------------------------------------------------------------------------------------------...

Creating output dynamically from Datareader using the format given in an XML file
Hey all, I have a problem, any solution would be greatly appreciated. I am given a datareader which contains some records as a result of a search. I have to present this output from the datareader on an aspx page using the format given in an XML file. I have to use this file only and according to the format laid out in this file, I have to use the given data reader, extract the records according to this format and dispaly on the page. The XML file is like that <COLUMNS> <COLUMN index='0'> <LINE index='0'> <ITEM index='0' type='FIELD'>field name...

Creating a PSR file without using a file
Is it possible within PB code to populate a string( or blob) variable with the syntax which is in a PSR file ? e.g. you can use saveas function but i want to store the PSR file in the database in the end so don't really want to create a file ? Any help Matt On Fri, 24 Mar 2000 11:03:57 -0000, "Matthew Green" <matthewgreen@powersoft-services.co.uk> wrote: >Is it possible within PB code to populate a string( or blob) variable with >the syntax which is in a PSR file ? > >e.g. you can use saveas function but i want to store the PSR file in...

Using XE2 to create .a files for use in iOS
All, I have been experimenting with XE2 recently, and have successfully created dylib files on OSX. At this point, I still use XCode / Objective-C to build iOS apps, but I would like to access methods of a Delphi-created class in iOS. Can XE2 help me do this? At first I was thinking I could use XE2 to build a dylib file on OSX, then embed this in my iOS app, but the iOS SDK doesn't support linking dylib files, and it seems that I can't build static libraries in XE2 targeting OSX (i.e. .a files). Has anyone else tried this? If so, could you provide an example? Thanks. > ...

Using XE4 to create .a files for use in iOS
Is it possible to create a static library with XE4 to export Objective-C classes that can be called from XCode? Thanks in advance Am 06.05.2013 17:21, schrieb chen xing: > Is it possible to create a static library with XE4 to export Objective-C classes that can be called from XCode? > > Thanks in advance > Hello, I don't know if it's possible or not, but I do know that your post belongs to a different forum. I'd suggest this one: embarcadero.delphi.plattformspecific.ios NNTP follow up set so answers via newsreaders will go there directly. Greet...

What program to use to create an executable that I can distribute with a palette so that a user could drag things from the palette to a form and then have a ASP, PHP, JavaScript etc. file output.
What I would like to do is develop an executable, such as a little VB form that comes with a little palette with different items that have classes in Internet Explorer, (Such as a textbox).  When the user drags that textbox from the palette onto the form the HTML code would be written into a file.  I have seen these express programs that Microsoft has put out for free which is pretty cool.  The problem is that I was looking over the Visual Web Developer and I see that it can do many things like Dreamweaver but I am not sure if it is cabable of creating a .exe file such as one ...

How to prevent "File in Use" when creating files
Hello, I want users to beable to click a button and get a delimited text file of data from the web application. 1.  I can't allow the TextFile.CreateText method to overwrite or append an existing file as it may be in use by another user.2.  So i could create random filenames...but then how do i manage them...know when to delete them, etc...3. What's the cleanest way to accomplish this?    a.) random file names with a cleanup routine that deletes them after a time passes?    b.) assemble the delimited data in memory and stream it to the client?&n...

How to use a .cs file to creat a .dll file manually?
Hello everyone I am trying to compile a .cs file into a .dll file by Command Prompt, i am not using Visual Studio.net. The root of HashFile.cs file is C:\HashFile.cs I know the command is: (but I don't know what here should be) /t:library/out:HashFile.dll HashFile.cs cheers! csc.exeRTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unreadableJason Brown - MVP, IIS In addition to the compiler itself (as shown by Atrax), you'll also need to reference some assemblies. Try: csc.exe /t:library /debug /out:HashFile.dll HashFile.cs /r:System.dll /r:...

How to Create .mdb file from Excel file using C#.net
Hi all I want to create .mdb file that i have created excel feel from MS jet Database... through code behind Help me in this..  Regards RaviPlease click "mark as answer" if this post helped you. How to create an mdb file programmtically:http://support.microsoft.com/kb/317881How to import Excel data into it: http://www.mikesdotnetting.com/Article.aspx?ArticleID=79 Regards Mike [MVP - ASP/ASP.NET]My site...

How to create a pdf file in asp.net with c# as one of the output file?
Hi All,I need to know whether creating a pdf file through asp.net is possible or not? For instance, i can create a excel file to export data as output. Likewise, i need to export some information in pdf format. It should then open and show the contents. Going further in this, can we also customize like displaying the user-login name as watermark so that each pdf created for every user is unique to him. How to achieve this task? Do we need to install any third party components which will provide methods/namespaces etc or can we do without any third party components?After reading many related ...

Read txt file and use each line as regex and output matches to file.
--------------enig6320889D80B32E6F799A5486 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi All! Please help this beginner! More than likely there is an easy way to do this and/or I am doing something stupid but I just don't know how. Sorry if this is a bit long. (Scenario) -Several routers/firewalls log events to a single ($log_file). -I want to be able to seperate the logs based on router/firewall IP addresses ($log_source) and dump all matches to their relevant files for further processing ($date-$ip.log) -Process the (...

How to Create and use web controls in c# instead of using them in aspx files?
Where can I find information about how to create and use web controls in c# (cs files) instead of using them in aspx files? It isn't to hard to create an instance of  a web control and binding data to it. But I have a lot of trouble to find out, what methods I have to use do common tasks like hiding the key column of a DataGrid. Where can I find useful information about that topic? The only resource I have is the .NET API documentation, but that isn't very useful for me. André Fröhlich Hi, what exactly are you after? Creating custom web controls / user controls? Or are you looking fo...

Creating an output file
Hi, How would I write to an output file using VB and ASP.net? Are there any faqs on the subject? Thanks! Define output file... what exactly do you want to output to the file? I'm not particularly sure what you mean by 'ouput' file - - however, this code sample shows how to create and write a text file: Creating & Writing Text FilesDavid WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calenda...

Web resources about - Create an output file using Perl - perl.beginners.cgi

Wikipedia:Why create an account? - Wikipedia, the free encyclopedia
This is Wikipedia . You do not have to log in to learn. Almost anyone can edit almost any article at any given time too, but be aware that the ...

Facebook Teams Up With Google, Microsoft, Others To Create WebPlatform.org, A Developer Support Hub
Facebook may have a tricky relationship with HTML5 , but it still wants developers all over the Web to learn how to use it efficiently. The social ...

Perth man ditches day job, creates Postcode Honey hive network
He quit the mining industry to chase his dream of making ultra-local honey accessible to everyone in Perth.

IAC Creates Publishing Unit
IAC has merged several of its brands into a new media unit called IAC Publishing. The publishing arm will include The Daily Beast, About.com, ...

Zomato for iOS now lets you create theme-based restaurant collections
... a new Collections tab that allows you to see and bookmark collections of thematically related restaurants by people you follow, and even create ...

Spotify lets you create your year in music
... and genres, top artists by season, total minutes of music streamed and total number of songs and artists played. Once your list is created ...

Verizon has hired thousands of people to create the video service it says will replace cable TV
It’s no secret that the traditional cable TV business is in trouble, as younger millennial cord-cutters don’t see a need to pay for TV service. ...

Trump’s call to ban Muslims would create H-1B, other turmoil
Early in his campaign, Republican presidential candidate Donald Trump established himself as a champion of restrictions on the H-1B visa program. ...

Can A Coupon Taste Good? Krispy Kreme Creates Barcode Of Glaze For Free Dozen Donut Coupon
... 12 free glazed dough tori from Krispy Kreme. To ensure everyone has their fair shot at what it’s calling #dayofthedozen, the company has created ...

Create royalty-free soundtracks with the click of your mouse
I just made three custom, royalty-free soundtracks using nothing more than a website and my Mac. I’ll be able to use these in any video project ...

Resources last updated: 12/10/2015 7:16:54 PM