[fpc-pascal]easier chmod command (linux)

Andreas K. Foerster AKFoerster at AKFoerster.de
Sun Oct 28 14:45:39 CET 2001


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsMode.pas
Type: text/x-pascal
Size: 815 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20011028/c27b285a/attachment.pas>


More information about the fpc-pascal mailing list