Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a file

Status
Not open for further replies.

kavi98

Programmer
Dec 14, 2000
48
0
0
US
When i try to create a file and write it to the path given it generates an error and the file is not created ,is it the directory rights or the way i am doing it the reason for its failure ,as i have checked the rights on the directory and there is a write access on it.

$filename = "/path/to/the/file/file$x.xml";
open(TAR,"> $filename") || die;

Thanks
Kavi98
 
a little tip, in change your code to:[tt]
open(...) or die($!);[/tt]

that way it'll output the failure message to STDERR, and you won't have to guess as much.

as to the question, it looks like it'll be a permissions error. the question is whether or not the user that's running the script has access to the folder. however, that's only speculation until the error message is examined. "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top