Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Newbie - Auto-create file with chmod
December 8, 2004, 2:15 am
rate this thread
there is not much data anyway, but I would like to automatize process
when I need a new chmod666 file on server. By now I created file
manually and then changed attributes to 666.
How can I create file when it's needed (script cannot find it so it
creates it) and chmod it to 666?
I guess there is a way to do it, but I just don't know it :-)
Re: Newbie - Auto-create file with chmod
exisiting_holder_file.txt needs to exist before the script is run, but
it can be an empty file. Use this function at the end of the code,
once you are done writing the file you need. if you are editing: read
the existing file into the script, edit it and save it away as
existing_holder_file.txt with the "w" switch (which empties the file
and overwrites it). Then copy the file with the above code to the
location and filename of your choice. You can call a cdmod after it is