Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: How to access files ' properties under Windows

From: chalz:earthlink at: 1-Aug-2002 0:58

I know that this is *insanely* late, but I just finally got around to this message. (I've been deleting messages/threads I'm not interested in, and saving interesting ones for later. Now happens to be later :P )
<snip> > >You don't need routines for that. REBOL can do that by itself, > >and in a platform-independent way. Check
http://www.rebol.com/docs/core25.html
> >and in particular the section on get/set-modes. > > > I thought so :-) Well, I just looked into docs and it works a little bit > strange way - I mean - syntax ... > > ---------- > > ->> get-modes somefileordir 'file-modes > == [file-note creation-date archived script (...a few more...) ] <snip>
Actually, I just read the text on it (the core25.html I have is more of a changelog; heh). I rather like the format. I think that the builtin help needs to be extended a touch, but otherwise, after having read the actual documentation, I think this is a neat system. Of course, there lies the problem that not all modes are available on all OS's, so you have to code with that in mind. But the basics are available all around. So if you're already familiar with what modes are available on all or target platforms, it's an easy task: get-modes %file 'read Cool. Um, though, I've encountered a problem...
>> get-modes %index.html 'file-modes
== [creation-date access-date modification-date owner-write archived hidden system full-path]
>> get-modes %index.html 'port-modes
== [read write binary lines no-wait direct]
>> get-modes %index.html 'read
== false
>> get-modes %index.html 'write
== false
>> get-modes %index.html 'binary
== false
>> set-modes %index.html [read: true]
** Script Error: Invalid argument: read ** Near: set-modes %index.html [read: true]
>> set-modes %index.html [write: true]
** Script Error: Invalid argument: write ** Near: set-modes %index.html [write: true]
>> set-modes %index.html [binary: true] >> get-modes %index.html 'binary
== false
>> get-modes %index.html 'hidden
== false
>> set-modes %index.html [hidden: true] >> get-modes %index.html 'hidden
== true
>>
Am I missing something? Why are read/write unsettable? I know the documentation says that only binary, lines and no-wait are settable... but why? --Charles