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

File-modes on different platforms

 [1/23] from: anton::lexicon::net at: 17-May-2002 17:38


Hello, I am interested to see the different file modes available on different platforms. I have tested on Windows2k and NT4. I need Linux, Amiga, Mac and any others. I would like you out there who have one of the above platforms to try the following code and report back with the result. save file: %anton-filemode-test "" ; create a file to experiment on foreach mode get-modes %dummy 'file-modes [ print [ type? get-modes file mode mode if error? set/any 'err try [ set-modes file compose [ (to-set-word mode) (get-modes file mode) ] ][probe disarm err] ] ] delete file ; clean up The code just prints out the datatype of each mode, the mode word, and reports if there was an error setting that mode. (I want to see which modes cannot be modified, if any.) Thank you very much, and thanks to Ammon for your response on this matter on 20 April. Anton.

 [2/23] from: carl:cybercraft at: 18-May-2002 9:54


On 17-May-02, Anton wrote:
> Hello, > I am interested to see the different file modes
<<quoted lines omitted: 20>>
> setting that mode. (I want to see which modes cannot > be modified, if any.)
On Amiga I get none for everything, which I guess is good?... date modification-date none integer owner-id none integer group-id none logic pure none logic script none logic hold none logic archived none logic owner-read none logic owner-write none logic owner-execute none logic owner-delete none logic group-read none logic group-write none logic group-execute none logic group-delete none logic world-read none logic world-write none logic world-execute none logic world-delete none none comment none -- Carl Read

 [3/23] from: ammon:rcslv at: 17-May-2002 10:22


Hello Anton, I have an Amiga 2K available to me for which I will now download /View and /Core, Afterwards I will run some tests for you. If I had a Mac I would do that one to, but I don't so.... To the List: I think that we should get more participation from you guys when someone asks for testing, it seems that eveyone wants lots of libraries, and modules available, but no one wants to give a little input to allow for the true crossplatform capability of REBOL. Enjoy!! Ammon --Smile, the whole world will light up for you!

 [4/23] from: greggirwin:mindspring at: 17-May-2002 10:53


Hi Anton, << (I want to see which modes cannot be modified, if any.) >> I'm on W2K so I won't report, but the beta versions seem to, correctly, not return 'full-path with copy-modes. Prior versions returned it, which was wrong. --Gregg

 [5/23] from: etienne:alaurent:free at: 18-May-2002 0:33


Hi Anton, I tested your script and I got this : make object! [ code: 305 type: 'script id: 'invalid-arg arg1: 'status-change-date arg2: none arg3: none near: [set-modes file compose [ (to-set-word mode) (get-modes file mode) ]] where: 'do-boot ] date status-change-date ?object? date modification-date none date access-date none string owner-name none string group-name none integer owner-id none integer group-id none logic owner-read none logic owner-write none logic owner-execute none logic group-read none logic group-write none logic group-execute none logic world-read none logic world-write none logic world-execute none logic set-user-id none logic set-group-id none make object! [ code: 305 type: 'script id: 'invalid-arg arg1: 'full-path arg2: none arg3: none near: [set-modes file compose [ (to-set-word mode) (get-modes file mode) ]] where: 'do-boot ] file full-path ?object? I hope it will be usefull for you. Anton wrote:
>Hello, >I am interested to see the different file modes
<<quoted lines omitted: 24>>
>on 20 April. >Anton.
-- regards. --- Etienne

 [6/23] from: etienne:alaurent:free at: 18-May-2002 3:26


Hi Anton, I forgot to tell you the results I sent were on linux. Anton wrote:
>Hello, >I am interested to see the different file modes
<<quoted lines omitted: 24>>
>on 20 April. >Anton.
-- regards. --- Etienne

 [7/23] from: tomc:darkwing:uoregon at: 17-May-2002 20:05


on Solaris REBOL/Core 2.5.0.10.1 23-Mar-2001 Copyright 2000-2001 REBOL Technologies. All rights reserved.
>> do %anton-test.r
make object! [ code: 305 type: 'script id: 'invalid-arg arg1: 'status-change-date arg2: none arg3: none near: [set-modes file compose [ (to-set-word mode) (get-modes file mode) ]] where: none ] date status-change-date ?object? date modification-date none date access-date none string owner-name none string group-name none integer owner-id none integer group-id none logic owner-read none logic owner-write none logic owner-execute none logic group-read none logic group-write none logic group-execute none logic world-read none logic world-write none logic world-execute none logic set-user-id none logic set-group-id none make object! [ code: 305 type: 'script id: 'invalid-arg arg1: 'full-path arg2: none arg3: none near: [set-modes file compose [ (to-set-word mode) (get-modes file mode) ]] where: none ] file full-path ?object?

 [8/23] from: anton:lexicon at: 18-May-2002 21:30


Thanks to all of you. Ok, I have: - Windows 2000 - Linux Ok, anyone who wants to help me on: - Amiga, Mac, BSD or any other platform than Windows 2000 or Linux, run this script and report the results: print reform [join "REBOL/" system/product system/version system/build/date] save file: %anton-filemode-test "" ; create a file to experiment on foreach mode get-modes %dummy 'file-modes [ print [ type? get-modes file mode mode if error? set/any 'err try [ set-modes file compose [ (to-set-word mode) (get-modes file mode) ] ][mold disarm err] ; <- mold instead of probe ] ] delete file ; clean up Anton.

 [9/23] from: ingo:2b1 at: 18-May-2002 22:42


Anton wrote:
> Thanks to all of you. > Ok, I have:
<<quoted lines omitted: 3>>
> - Amiga, Mac, BSD or any other platform > than Windows 2000 or Linux, run this script and report the results:
These are the results on Windows 98 REBOL/View 1.2.1.3.1 21-Jun-2001 date creation-date none date access-date none date modification-date none logic owner-write none logic archived none logic hidden none logic system none Kind regards, Ingo

 [10/23] from: anton:lexicon at: 20-May-2002 1:37


Carl, I just read your mail, thanks. Ok, now I have the Amiga results too. But notice the "comment" file-mode at the bottom: "none" ?? What rebol value has type none ? Can you investigate this Carl? get-modes %afile 'comment Anton.

 [11/23] from: nitsch-lists:netcologne at: 19-May-2002 20:38


Am Sonntag, 19. Mai 2002 17:37 schrieb Anton:
> Carl, I just read your mail, thanks. > Ok, now I have the Amiga results too. > > But notice the "comment" file-mode at the bottom: "none" ?? > What rebol value has type none ? >> type? none
== none!
> Can you investigate this Carl? > =09get-modes %afile 'comment
<<quoted lines omitted: 53>>
> > -- > > Carl Read
Volker

 [12/23] from: carl:cybercraft at: 20-May-2002 13:53


On 20-May-02, Anton wrote:
> Carl, I just read your mail, thanks. > Ok, now I have the Amiga results too. > But notice the "comment" file-mode at the bottom: "none" ?? > What rebol value has type none ? > Can you investigate this Carl? > get-modes %afile 'comment
Hi Anton, Seems if the file has no comment a 'none's returned, not an empty string...
>> get-modes %anton-filemode-test 'comment
== none And after adding a comment to your file...
>> get-modes %anton-filemode-test 'comment
== "Test-comment" Should this be considered a bug? Carl.
> Anton. >> On 17-May-02, Anton wrote:
<<quoted lines omitted: 45>>
>> -- >> Carl Read
-- Carl Read

 [13/23] from: anton:lexicon at: 21-May-2002 0:04


Thanks Carl, I don't think it should be a bug, it's just an inconvenience for me, trying to automatically determine the type so I can generate the appropriate gui element to edit it. Maybe I can make it into a feature request. If each mode returns only one type (ie. never none), that allows my script to determine the gadget to be used automatically, in a very elegant way. I wonder if there are any other file-modes that return none sometimes. Anton.

 [14/23] from: nitsch-lists:netcologne at: 21-May-2002 1:30


Hi Anton, Am Montag, 20. Mai 2002 16:04 schrieb Anton:
> Thanks Carl, > I don't think it should be a bug, it's just an
<<quoted lines omitted: 7>>
> I wonder if there are any other file-modes that > return none sometimes.
i started to find 'none very convenient, after discovering i can do: any[comment "no comment"] when empty strings are none. easy default-values that way. originally when dealing with parse, but may be handy here too.
> Anton. > > > But notice the "comment" file-mode at the bottom: "none" ??
<<quoted lines omitted: 19>>
> > > > Carl.
greeting Volker

 [15/23] from: anton:lexicon at: 23-May-2002 0:20


I am aware of this neat trick, but the problem, again, is that I cannot determine which gadget to add to the layout from a none value. Anton.

 [16/23] from: anton:lexicon at: 19-May-2002 15:40


This is a call-out to everyone with different OS's than mine. Thankyou Micael, Tom. Platforms with results so far: - Windows 2000 - Linux - Sun Solaris Sparc Right, I need: - Amiga - Mac - BSD - (and any others). (Come on, Gabriele! I know you have an Amiga...) Simply run this script and report the results back to the list. You don't have to do anything else: print reform [join "REBOL/" system/product system/version system/build/date] save file: %anton-filemode-test "" ; create a file to experiment on foreach mode get-modes %dummy 'file-modes [ print [ type? get-modes file mode mode if error? set/any 'err try [ set-modes file compose [ (to-set-word mode) (get-modes file mode) ] ][mold disarm err] ; <- mold instead of probe ] ] delete file ; clean up Anton.

 [17/23] from: al:bri:xtra at: 24-May-2002 18:39


Windows XP Home with Rebol/Core
>> print reform [join "REBOL/" system/product system/version
[ system/build/date] REBOL/Core 2.5.0.3.1 23-Mar-2001
>> save file: %anton-filemode-test "" ; create a file to experiment on >> foreach mode get-modes %dummy 'file-modes [
[ print [ [ type? get-modes file mode [ mode [ if error? set/any 'err try [ [ set-modes file compose [ [ (to-set-word mode) (get-modes file mode) [ ] [ ][mold disarm err] ; <- mold instead of probe [ ] [ ] date creation-date none date access-date none date modification-date none logic owner-write none logic archived none logic hidden none logic system none file full-path make object! [ code: 305 type: 'script id: 'invalid-arg arg1: 'full-path arg2: none arg3: none near: [set-modes file compose [ (to-set-word mode) (get-modes file mode) ]] where: none ]
>> delete file ; clean up
Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [18/23] from: ammon:rcslv at: 20-May-2002 22:21


hi, Why can't you? Give us an example, please. Thanks!! Ammon A short time ago, Anton, sent an email stating:

 [19/23] from: anton:lexicon at: 26-May-2002 15:41


Each of the file-modes have (so far) four different datatypes. I am mapping each of the different datatypes, (so far: date!, logic!, string! integer!) to different user interface gadgetry. ie. date! and string! types cause a field to be added, but a logic! causes a check to be added to the layout. You get it now? If my code gets a none!, how is it supposed to know what type of gadgets to add to the layout to edit that file-mode? No big deal, I have added a special check for amiga's comment file-mode. It's just that I would prefer not to have OS specific code in my program. Anton.

 [20/23] from: g:santilli:tiscalinet:it at: 26-May-2002 12:34


Hi Anton, On Sunday, May 26, 2002, 7:41:53 AM, you wrote: A> You get it now? If my code gets a none!, how is it A> supposed to know what type of gadgets to add to the layout A> to edit that file-mode? You add a field, and let the user decide what to do. Or you try setting it to see what happens. Or you ask the user and then save the information in some file that can then be shipped with the program. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [21/23] from: carl:cybercraft at: 27-May-2002 0:33


On 26-May-02, Gabriele Santilli wrote:
> Hi Anton, > On Sunday, May 26, 2002, 7:41:53 AM, you wrote:
<<quoted lines omitted: 5>>
> the information in some file that can then be shipped with the > program.
You may have meant this Gabriele by your first suggestion, but how about if on getting a none the user is presented with the file-mode's name and asked to choose the appropriate gadget from a list of options? -- Carl Read

 [22/23] from: nitsch-lists:netcologne at: 26-May-2002 16:58


Am Sonntag, 26. Mai 2002 14:33 schrieb Carl Read:
> On 26-May-02, Gabriele Santilli wrote: > > Hi Anton,
<<quoted lines omitted: 12>>
> name and asked to choose the appropriate gadget from a list of > options?
How to let the user point to a reference-file with valid comment, and use that type? -volker

 [23/23] from: greggirwin:mindspring at: 26-May-2002 11:55


Hi Anton, et al << Each of the file-modes have (so far) four different datatypes. I am mapping each of the different datatypes, (so far: date!, logic!, string! integer!) to different user interface gadgetry...You get it now? If my code gets a none!, how is it supposed to know what type of gadgets to add to the layout to edit that file-mode? >> What about this, you have a mapping table of datatype-to-field values which starts out blank (it's an external file and so is non-existent on initial runs). When the app starts up, it does a check of a) itself, and b) a random sampling of files to see what file modes are available on the current OS. If, when done with that, any of the modes it found came back with none! values for *all* the files it looked at, then you prompt the user to pick a gadget type. I.e. by looking at a sampling of files, you stand a better chance of finding at least one that has a value for each mode. --Gregg

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted