Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-10

easier chmod command (linux)

2 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andreas K. Foerster

Hello,

Shit happens.
I've written a new function, for to use the command chmod (unit Linux). I sent it to Michael van Canneyt (maintainer of the linux unit). And he sent me a very strange answer, that he had just recently written something similar... hmmm?

But for those, who have use for it, I send here my version. I have made it myself, independently from his one.

It's a much more convenient way to use the function chmod. With it you can enter the filemode as it is shown by "ls -l". So, you could even call it WYSIWYG. ;-)

EAMPLES:

    chmod(filename, lsMode('rw-r--r--'));
    chmod(progname, lsMode('-rwxr-sr-x')); { setgid }
    chmod(dirname,  lsMode('drwxr-xr-t')); { sticky }

REMARKS:
The directory field it just silently ignored.
You needn't enter it anyway.

'rwx' ==> ------rwx
'****-**-*' ==> rwxr-xr-x
'very stupid!' ==> rwsrwxrwx
(the 's' is in the right place, hihi!)

Tschuess Andreas

Reply by email

Andreas K. Foerster
to Andreas K. Foerster
Andreas K. Foerster wrote
It's a much more convenient way to use the function chmod.

Perhaps I should say, that this doesn't work this way under Kylix. Under Kylix you have to work with a separate variable and then assign this variable to the function name at the end.

Tschuess Andreas

Reply by email