?
Solved

Writing to a File on NT using CGI-PERL

Posted on 1998-11-30
6
Medium Priority
?
202 Views
Last Modified: 2013-12-25
I am trying to get a cgi perl script to run on an NT Server which was previously used with a unix box. The problem that I am having is trying to write some sample data to a temporary file, which is then used by a program and outputs the proper output.

This worked fine under UNIX, but I am having problems even writing to the file through the cgi-script. So basically whatever is in the temporary file before the script is running is then outputed to the html page. I was wondering if there is a way to do this in NT?

Any help is appreciated

Quinn Liddicoat
qoliddic@gulf.uvic.ca
0
Comment
Question by:qoliddic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:qoliddic
ID: 1829831
Edited text of question
0
 
LVL 1

Expert Comment

by:squimph
ID: 1829832
Can you be more specific what you mean by "problems"? What error message does your script get? When does happen... when opening the file for writing, or when actually trying to write to the file? What is in the $! and $? variables in perl after the error occurs?
0
 
LVL 11

Expert Comment

by:mouatts
ID: 1829833
I don't know what version of PERL you are using but the best one for NT is available from www.ActiveState.com (as I've said in a previous answer I have nothing to do with this company).

With this you should be able to run the CGI script unaltered including the use of forward slashes (yes on NT).

I have ported a number of systems from Unix to NT using this version and have had no major problems.

Steve
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:qoliddic
ID: 1829834
There is no error message that prints out, just the unaltered data, and sometimes the process will run rampent across the server taking up cpu space, and the temp file will still unchanged.

I alreday have active state installed, but I will try the original script and see what happens.

Thanks for your comments
0
 
LVL 8

Accepted Solution

by:
shlomoy earned 200 total points
ID: 1829835
I'd check the permissions on the files you want to alter.
the have to have read/write/execute permissions for user/group/other

use the following on the filr you want to alter (from the command prompt):

$ chmod 777 yourFile.

now - assumming that was your problem - this should do the trick.

I'd also make sure that the directory which holds that altered file has 777 permissions too.

if you're wondering why - it's because your CGI runs as user "nobody" - and so it needs to have permission to alter files (to be exact - the files need to have permissions).
You could run it as a unix user because it was your script and there were your files - so no permissions problem here. but as soon as you're running it as a CGI - it's not you who runs it but user nobody.
0
 

Author Comment

by:qoliddic
ID: 1829836
Well figured, what i was doing wrong, thanks for all your help though. The problem was with the path of the file in NT
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question