11-14-2003
Making files readonly with vi?
Hi,
I'm new at this whole Unix thing, but definately learning (lots of fun)...
and I was wondering - how do you make a file read-only with vi? I don't mean how do you load up vi in read-only mode, but how do you save a file (or flag a file, or whatever) in vi to read-only? How do you make it not read-only after it has been set to read-only? Thanks a lot!
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I am stuck up in middle of a script.Pls have a look at the problem and help me in any way out for the same.
There are n number of files with n number of contents in a column.
for example :
file1 has contents in quotes
"abcd"
"1234-asbcd"
"12312".....
file2 has contents in... (4 Replies)
Discussion started by: er_aparna
4 Replies
2. Shell Programming and Scripting
Hi guys,
I'm a little stuck on this problem, I've tried googling it and some trial and error but can't seem to get it working.
Basically I need the script to:
1) create a directory called "mybackups", if it doesn't exist
2) go through all the .sh files in the current directory, and copy... (4 Replies)
Discussion started by: chazij
4 Replies
3. Shell Programming and Scripting
Hi,
I am really sorry for posting a newbie question here, but I do not have time to start learning shell scripting at the very moment.
My question is how can I write a script what takes a file with a variable number, changes the variable number to a new number and saves the file as a new... (5 Replies)
Discussion started by: mario8eren
5 Replies
4. Shell Programming and Scripting
New Unix user/scripter here. Been trying to solve a problem for two days now with no luck. Hoping someone here has an answer.
Essentially I have a list of wtmp files which I have decompressed and copied to a temporary directory. Using the following command I can turn them into a file than can... (4 Replies)
Discussion started by: Stryfe16
4 Replies
5. UNIX for Advanced & Expert Users
I have the following folder structure
code/f1/
code/lib/t1
code/lib/t2
code/lib/t3
code/lib/t3
code/lib_1/t1
code/exc
I would like to create a tar with a folder structure below and I can use the following tar command
f1
lib/t1
lib/t2
lib/t3
tar -cvf code.tar -C code f1 lib... (4 Replies)
Discussion started by: alpboys
4 Replies
6. Shell Programming and Scripting
Hello,
I would like to make a script that searches through a SRC folder and copies only files it's never seen before to a DEST folder.
SRC = /user/.phonesync/photos-backup
DST = /usr/.phonesync/photos-new
So basically, I'd start with a:
md5sum /user/.phonesync/photos-backup/* >... (29 Replies)
Discussion started by: nbsparks
29 Replies
7. Shell Programming and Scripting
Hi All,
I have a text file (code_data.txt) with the followig data.
AMAR AB123456 XYZ
KIRAN CB789 ABC
RAJ CS78890 XYZ
KAMESH A33535335 ABC
KUMAR MD678894 MAT
RITESH SR3535355... (26 Replies)
Discussion started by: ROCK_PLSQL
26 Replies
8. Shell Programming and Scripting
I'm having trouble because, for some reason, cp -R missed a few files. And so did xcopy/s.
Since I'm running Cygwin on Win10, I decided to see if robocopy would be more effective. The trouble is someone, maybe xcopy/s or cp -R dutifully set certain files to be read only so when I try a... (6 Replies)
Discussion started by: siegfried
6 Replies
LEARN ABOUT LINUX
packfile_password
packfile_password(3alleg4) Allegro manual packfile_password(3alleg4)
NAME
packfile_password - Sets the global I/O encryption password. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
void packfile_password(const char *password);
DESCRIPTION
Sets the encryption password to be used for all read/write operations on files opened in future using Allegro's packfile functions (whether
they are compressed or not), including all the save, load and config routines. Files written with an encryption password cannot be read
unless the same password is selected, so be careful: if you forget the key, nobody can make your data come back again! Pass NULL or an
empty string to return to the normal, non-encrypted mode. If you are using this function to prevent people getting access to your
datafiles, be careful not to store an obvious copy of the password in your executable: if there are any strings like "I'm the password for
the datafile", it would be fairly easy to get access to your data :-)
Note #1: when writing a packfile, you can change the password to whatever you want after opening the file, without affecting the write
operation. On the contrary, when writing a sub-chunk of a packfile, you must make sure that the password that was active at the time the
sub-chunk was opened is still active before closing the sub-chunk. This is guaranteed to be true if you didn't call the packfile_password()
routine in the meantime. Read operations, either on packfiles or sub-chunks, have no such restriction.
Note #2: as explained above, the password is used for all read/write operations on files, including for several functions of the library
that operate on files without explicitly using packfiles (e.g. load_bitmap()). The unencrypted mode is mandatory in order for those func-
tions to work. Therefore remember to call packfile_password(NULL) before using them if you previously changed the password. As a rule of
thumb, always call packfile_password(NULL) when you are done with operations on packfiles. The only exception to this is custom packfiles
created with pack_fopen_vtable().
SEE ALSO
pack_fopen(3alleg4), load_datafile(3alleg4), pack_fopen_vtable(3alleg4)
Allegro version 4.4.2 packfile_password(3alleg4)