Re: [kde] Kate - opening unwritable files in read-only mode.



On Monday 14 April 2008 1:07:41 pm RW wrote:
Is it possible to have Kate automatically open files in
read-only mode when I don't have write permission on them?

Since the permissions set on the file will determine what kate
(as you) can do with the file, trying to save changes to it will
cause an error.

Alternately is it possible to select read-only mode from the
command line?

This question is partly answered with kate --help at the shell.

You could use a shell script to change permissions on the file
before opening it:

if [[ -w file ]]; then
chmod -w file
fi
kate file

This will fail if you are unable to change permissions on the
file, such as when you don't own it.
--
Scott
Linux user #: 246504
___________________________________________________
This message is from the kde mailing list.
Account management: https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.



Relevant Pages

  • Re: scanning problem on 10.1
    ... Garry Knight wrote: ... How come I can run Kate as user but not the other two? ... That's not the permissions, that's the ownership. ... So I suspect this has something to do with the permissions of the scanner ...
    (alt.os.linux.suse)
  • scanning problem on 10.1
    ... similarly for xsane. ... So I tried to run it as root. ... So the permissions appear to be wrong, but before I tried to change the ... I can run kate as user. ...
    (alt.os.linux.suse)
  • Re: scanning problem on 10.1
    ... How come I can run Kate as user but not the other two? ... That's not the permissions, that's the ownership. ... The owning group can read it and execute it, ... open a console and enter 'man chmod'. ...
    (alt.os.linux.suse)
  • Re: [kde] Kate - opening unwritable files in read-only mode.
    ... read-only mode when I don't have write permission on them? ... Since the permissions set on the file will determine what kate ... could pick-up the initial state of this from the file permissions. ...
    (KDE)
  • Re: File names with spaces driving me insane!!!
    ... modes, depending on file type. ... method to change the permissions of certain file types, which is reliable for the majority of files. ... Of course, if you have a shell script and no #!/bin/bash as the first line, the file command just recognizes it as a text file. ... file had 100% success in finding executables. ...
    (comp.unix.shell)