PDA

View Full Version : Change of location of dat.file


hkgray
10-19-2002, 08:50 AM
Dear All,

If I created a form and tried to save the data file in a specific directory, how I can achieve this?

Thanks
Raymond

chrisvmarle
10-19-2002, 11:29 AM
$file_to_open = "../datafiles/file.dat";
open(FILE,">$file_to_open");

This script will open the file.dat in the directory datafiles (up one dir)

Example:
If the script is /home/usr/me/cgi-bin/script.cgi
The file.dat will be /home/usr/me/datafiles/file.dat

On windows it will be like this:
If the script is c:/website/cgi-bin/script.cgi
The file.dat will be c:/datafiles/file.dat

Hope it's clear :)

Mzzl, Chris