[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] File Problems



According to Adam Reynolds:
> 
> I am trying to create a new file here, I later write to it then close
> it.  On my own system this works but not on the server.
> 
> If anybody can help I would really appreciate it . . .

Errrr....this really isn't a MacPerl problem, but I think I
know what the problem is.

If the server is running on a Unix machine, then what is
happening is that the server creates the file as WWW for
the owner and group.  This can cause all sorts of
problems.  For instance, we have two separate computers
which handle files here.  One of them knows who WWW is and
the other doesn't.  So when I'm playing around with ideas
in my directory, I have to be careful because I can wind up
with files which I can not do anything about.  :-/

So, to make a long story short - you should always give
your files read, write, and execute privileges for everyone
so when you come along afterwards you can do whatever it is
you need to do to them without any kind of problems.  But
this is only on TEMPORARY FILES.  Not your permanent
files.  Permanent files you usually want everyone to be
able to read the files - but not write to them or
(sometimes) execute them.

So what you want to do is, is to always:

1. Do a CHMOD after the creation of a file.
2. Do a CHGRP so you own the files.
3. Do a CHOWN so you own the files.

After every time you create a file which you are going to
leave lying around on your hard drive.  This will make it
so you can work with the files after the web server is done
with them.


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch