CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Writing to a flat file



Jan 23, 2000, 3:55 PM

Post #1 of 3 (2672 views)
Writing to a flat file Can't Post


I've got a question about writing to a flat file.

I'm reading a file in OK and and want to write to a new output file in the same directory. But I get permission errors when opening the output file. This is because the parent directory does not allow write to the world (I presume that a CGI program is deemed to have world access to a directory.)

I cannot make this directory writable because it is a subdirectory of where the web site resides. My ISP says that they cannot open the parent directory to the world for writing because they would need to change the directory above that which would effectively give everyone write access to all of their customers' web areas.

They say that there must be some other way around this problem but I can't think of a good way - I've thought of having a separate directory outside the web site area which is used for storing the data files but this seems a bit cumbersome.

Has anyone got any ideas?


Administrator / Moderator

Jan 23, 2000, 7:16 PM

Post #2 of 3 (2672 views)
Re: Writing to a flat file [In reply to] Can't Post

Actually, the most secure location for files is outside of your www directory (in your root directory). Just so I understand your permissions problem... for example, you have your file at

http: //

and you can't change permissions on subdirectory? It's completely understandable that its parent directory (your www directory) can't be changed, but it sounds strange that subdirectory can't be changed.

What's the current permission settings on subdirectory and file.txt?

What OS is your site running on?


Jan 24, 2000, 3:01 PM

Post #3 of 3 (2672 views)
Re: Writing to a flat file [In reply to] Can't Post

Sorry Jasmine - I was writing complete garbage. I wasn't the owner of the directory which is the reason I couldn't change the permissions. I completely lost it yesterday. Didn't mean to waste your time.

Your comment about putting the file outside the www area makes sense but I can't do that for this site - the ISP keeps all files for its customers under single entry directories (which makes sense really). I can't see any way to protect the file too much but take some comfort that a hacker would probably need to get into the ISP itself before getting to my site (hopefully the ISP security is pretty strict).

Thanks for your help,



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives