News:
Rio has finally made it to (roughly) where it was planned to be all along. File manipulations that work locally should now also work remotely. e.g. dir := 'ftp://squeak:viewpoints@.../test/test/test' asRio mkpath. file := dir / 'hello.txt' contents: 'hello world'. next := file rename nextVersion. next name. { hello.1.txt } next fileSize. {11} next copyTo: 'local.txt' Limitations: Although you can obtain read or writeStreams directly into the remote file, it is not random access (yet?) therefore you cant currently write directly to the write stream of a remote gzip file (which you can do locally) More Info: http://wiki.squeak.org/squeak/5929 cheers Keith |
Rio has now been refactored so as to be cleaner and to avoid any such
tricks as doesNotUnderstand: best regards Keith > *News:* > > Rio has finally made it to (roughly) where it was planned to be all along. > File manipulations that work locally should now also work remotely. > > e.g. > > dir := 'ftp://squeak:[hidden email]/test/test/test' > asRio mkpath. > file := dir / 'hello.txt' contents: 'hello world'. > > next := file rename nextVersion. > next name. { hello.1.txt } > next fileSize. {11} > > next copyTo: 'local.txt' > > *Limitations:* > > Although you can obtain read or writeStreams directly into the remote > file, it is not random access (yet?) > therefore you cant currently write directly to the write stream of a > remote gzip file (which you can do locally) > > *More Info:* > > http://wiki.squeak.org/squeak/5929 > > cheers > > Keith > ------------------------------------------------------------------------ > > > |
Now that the architecture for Rio is complete. Its time for a vote!
Current usage.... 'someDir/someFile' asRio -> instance of Rio. 'someDir/newDir' asRio mkdir -> instance of Rio. 'someDir/file.zip' asRio zip -> instance of RioArchive. Could change to usage..... 'someDir/someFile' asFile. -> instance of File. 'someDir/newDir' asDirectory -> instance of Directory. 'someDir/file.zip' asFile zip -> instance of FileArchive. I like the original #asRio, and I wonder if there are any other smalltalks which already use #asFile and #asDirectory, and classes File and Directory. Nevertheless I can see why people would prefer the latter. votes? Keith |
2008/11/12 Keith Hodges <[hidden email]>:
> Now that the architecture for Rio is complete. Its time for a vote! > > Current usage.... > > 'someDir/someFile' asRio -> instance of Rio. > 'someDir/newDir' asRio mkdir -> instance of Rio. > 'someDir/file.zip' asRio zip -> instance of RioArchive. > > Could change to usage..... > > 'someDir/someFile' asFile. -> instance of File. > > 'someDir/newDir' asDirectory -> instance of Directory. > > 'someDir/file.zip' asFile zip -> instance of FileArchive. > > I like the original #asRio, and I wonder if there are any other > smalltalks which already use #asFile and #asDirectory, and classes File > and Directory. Nevertheless I can see why people would prefer the latter. > > votes? > > Keith > > > -- Best regards, Igor Stasenko AKA sig. |
>> I like the original #asRio, and I wonder if there are any other >> smalltalks which already use #asFile and #asDirectory, and classes File >> and Directory. Nevertheless I can see why people would prefer the latter. >> >> votes? >> >> > both? :) > > Keith |
2008/11/12 Keith Hodges <[hidden email]>:
> >>> I like the original #asRio, and I wonder if there are any other >>> smalltalks which already use #asFile and #asDirectory, and classes File >>> and Directory. Nevertheless I can see why people would prefer the latter. >>> >>> votes? >>> >>> >> both? :) >> >> > Igor, has anyone ever called you a trouble maker? > okay, okay.. :) it is really hard to choose. I'd prefer #asFile, #asDirectory , because its less ambiguous and better indicates one's intent. But, as i read from your docs, if i not mistaken, behind these methods you having an instance of same class. From this perspective, there's enough a single selector to convert string into rio instance. It also puts less fat in String protocol (if anyone cares). > Keith > -- Best regards, Igor Stasenko AKA sig. |
Igor Stasenko wrote:
> 2008/11/12 Keith Hodges <[hidden email]>: > >>>> I like the original #asRio, and I wonder if there are any other >>>> smalltalks which already use #asFile and #asDirectory, and classes File >>>> and Directory. Nevertheless I can see why people would prefer the latter. >>>> >>>> votes? >>>> >>>> >>>> >>> both? :) >>> >>> >>> >> Igor, has anyone ever called you a trouble maker? >> >> > > okay, okay.. :) > it is really hard to choose. I'd prefer #asFile, #asDirectory , > because its less ambiguous and better indicates one's intent. > But, as i read from your docs, if i not mistaken, behind these methods > you having an instance of same class. From this perspective, there's > adaptors. Once it realised that it was pointing to a directory, it would switch its adaptor to one providing an api for directories. However adaptors are no more, and became Rio, with subclass RioDir. However I wanted to avoid any magic such as become, if the switch was to be automatic, so I merged the protocol of RioDir into Rio. The asDirectory option would make the decision manual, and would enable Rio an RioDir (File and Directory) to be effective and separate again Keith > enough a single selector to convert string into rio instance. It also > puts less fat in String protocol (if anyone cares). > > >> Keith >> >> > > |
In reply to this post by Igor Stasenko
I'm wary of the potential for namespace collisions with names such as
#asFile and #asDirectory. What about #asRioFile and #asRioDirectory?
If Rio were to become so wildly popular that it is adopted as the
default, #asFile and #asDirectory might make more sense.
Cheers, Josh Igor Stasenko wrote: 2008/11/12 Keith Hodges [hidden email]:Now that the architecture for Rio is complete. Its time for a vote! Current usage.... 'someDir/someFile' asRio -> instance of Rio. 'someDir/newDir' asRio mkdir -> instance of Rio. 'someDir/file.zip' asRio zip -> instance of RioArchive. Could change to usage..... 'someDir/someFile' asFile. -> instance of File. 'someDir/newDir' asDirectory -> instance of Directory. 'someDir/file.zip' asFile zip -> instance of FileArchive. I like the original #asRio, and I wonder if there are any other smalltalks which already use #asFile and #asDirectory, and classes File and Directory. Nevertheless I can see why people would prefer the latter. votes?both? :)Keith |
In reply to this post by keith1y
Keith Hodges wrote:
> I like the original #asRio, and I wonder if there are any other > smalltalks which already use #asFile and #asDirectory, and classes File > and Directory. Nevertheless I can see why people would prefer the latter. Visual Smalltalk uses both Directory and File. VW seems to treat Files and Directories like Java does. |
Claus Kick wrote:
> Keith Hodges wrote: > >> I like the original #asRio, and I wonder if there are any other >> smalltalks which already use #asFile and #asDirectory, and classes File >> and Directory. Nevertheless I can see why people would prefer the >> latter. > > Visual Smalltalk uses both Directory and File. > Now there's a shame > VW seems to treat Files and Directories like Java does. which is ? Keith |
Keith Hodges wrote:
> Claus Kick wrote: >> Keith Hodges wrote: >> >>> I like the original #asRio, and I wonder if there are any other >>> smalltalks which already use #asFile and #asDirectory, and classes File >>> and Directory. Nevertheless I can see why people would prefer the >>> latter. >> Visual Smalltalk uses both Directory and File. >> > Now there's a shame >> VW seems to treat Files and Directories like Java does. > which is ? Keith, you can look at Sport package and its SpFilename which is, well, almost complete copy of VW's Filename, yet much simpler than current Squeak offerings. SpFilename deals with both files and directories. SpFilename is not perfect, but from seeing most of Smalltalks and their file handling it is IMHO still the best. Best regards Janko -- Janko Mivšek AIDA/Web Smalltalk Web Application Server http://www.aidaweb.si |
Janko Mivšek wrote:
> Keith Hodges wrote: >> Claus Kick wrote: >>> Keith Hodges wrote: >>> >>>> I like the original #asRio, and I wonder if there are any other >>>> smalltalks which already use #asFile and #asDirectory, and classes >>>> File >>>> and Directory. Nevertheless I can see why people would prefer the >>>> latter. >>> Visual Smalltalk uses both Directory and File. >>> >> Now there's a shame >>> VW seems to treat Files and Directories like Java does. >> which is ? > > Keith, you can look at Sport package and its SpFilename which is, > well, almost complete copy of VW's Filename, yet much simpler than > current Squeak offerings. SpFilename deals with both files and > directories. that it is relatively simple. Sport is like Fileman in that it is a layer on top of squeak's FileDirectory. This differs from Rio in that Rio operates directly to the primitives. So I think Rio could perhaps deserve to use class names "File" and "Directory", but portability could be an issue. Rio's goals, inspired by Rio from Ruby. 1. Ground up replacement for the much hated (by me) FileDirectory (i.e. works at the primitive level) 2. Identical Remote / Local api 3. Handle recursive directory traversing, and interact nicely in collections 4. Identical compressed/uncompressed api 5. Treat a zip archive like a filesystem with the same api. Does VW have "File" or does it have "Filename" I am confused. > SpFilename is not perfect The plan for Rio was to see if it could be an ideal solution for Squeak. The next question is how portable can it be. Keith > , but from seeing most of Smalltalks and their file handling it is > IMHO still the best. but you are biased, as am I ;-) > Best regards > Janko > > |
For VW, I would put your File and Directory in a Rio namespace.
-david
On Wed, Nov 12, 2008 at 4:36 PM, Keith Hodges <[hidden email]> wrote: Janko Mivšek wrote: |
In reply to this post by keith1y
On Tue, Nov 11, 2008 at 4:25 PM, Keith Hodges <[hidden email]> wrote:
> Now that the architecture for Rio is complete. Its time for a vote! > > Current usage.... > > 'someDir/someFile' asRio -> instance of Rio. > 'someDir/newDir' asRio mkdir -> instance of Rio. > 'someDir/file.zip' asRio zip -> instance of RioArchive. > > Could change to usage..... > > 'someDir/someFile' asFile. -> instance of File. > > 'someDir/newDir' asDirectory -> instance of Directory. > > 'someDir/file.zip' asFile zip -> instance of FileArchive. > > I like the original #asRio, and I wonder if there are any other > smalltalks which already use #asFile and #asDirectory, and classes File > and Directory. Nevertheless I can see why people would prefer the latter. > > votes? I think you should stick with #asRio. Methods like #asFile should be reserved for a portability layer. Programs that use the portable versions shouldn't care which file package they are using, while those that use #asRio can depend on special features of Rio. One of the nice things about using #asRio is that then application programs do not have to know about the names of classes. Perhaps File and Directory should be RioFile and RioDirectory to avoid namespace collisions. -Ralph |
In reply to this post by keith1y
Keith Hodges wrote:
>>VW seems to treat Files and Directories like Java does. > > which is ? In VW, its called FileName, in Java its called File, both however apply to both files and directories. In Dolphin, it is File which also handles both. I dont recall offhand what is is like for Smalltalk/MT, Gnu/Smalltalk or Smalltalk/X. |
Free forum by Nabble | Edit this page |