Hi, Does anyone know how I can/should concatenate 2 FileReference paths ? Given /tmp/my-cache and a/b/data.txt I want to get /tmp/my-cache/a/b/data.txt in such a way that it is a correct, useable path. Next I want to do #ensureDirectory on the parent and write to the file. '/tmp/my-cache' asFileReference / 'a/b/data.txt' asFileReference does not work. '/tmp/my-cache' asFileReference / 'a/b/data.txt' works but is wrong internally. I can't figure out the semantics of #, TIA, Sven
Apparently it is #resolve: '/tmp/data-dir/' asFileReference resolve: 'a/b/c/file.txt' asFileReference Way too many methods on the public classes of FileSystem are undocumented. On 21 Jun 2013, at 16:31, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi,
Does anyone know how I can/should concatenate 2 FileReference paths ?
Given /tmp/my-cache and a/b/data.txt I want to get /tmp/my-cache/a/b/data.txt in such a way that it is a correct, useable path. Next I want to do #ensureDirectory on the parent and write to the file.
'/tmp/my-cache' asFileReference / 'a/b/data.txt' asFileReference
does not work.
'/tmp/my-cache' asFileReference / 'a/b/data.txt'
works but is wrong internally.
I can't figure out the semantics of #,
TIA,
Sven
Sven Van Caekenberghe-2 wrote
Apparently it is #resolve: ... Way too many methods on the public classes of FileSystem are undocumented.
Will you be adding that one? ;) ----- Cheers, Sean -- View this message in context: http://forum.world.st/FileSystem-Question-tp4694422p4694455.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
I did my best to comment what I could really understand. Now as soon as somebody understand more he should have the reflex to add comments. I was always confused by resolve: Stef
Apparently it is #resolve:
'/tmp/data-dir/' asFileReference resolve: 'a/b/c/file.txt' asFileReference
Way too many methods on the public classes of FileSystem are undocumented.
On 21 Jun 2013, at 16:31, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi,
Does anyone know how I can/should concatenate 2 FileReference paths ?
Given /tmp/my-cache and a/b/data.txt I want to get /tmp/my-cache/a/b/data.txt in such a way that it is a correct, useable path. Next I want to do #ensureDirectory on the parent and write to the file.
'/tmp/my-cache' asFileReference / 'a/b/data.txt' asFileReference
does not work.
'/tmp/my-cache' asFileReference / 'a/b/data.txt'
works but is wrong internally.
I can't figure out the semantics of #,
TIA,
Sven
I know you did, but it is as you say: this should be done by someone who really understands the design. For example: I learned about #resolve: from comments at the Disk implementation level, not the Public API level where there are almost no commennts. I got into several loops using wrong methods, those should have been marked private I would guess. On 21 Jun 2013, at 22:58, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
I did my best to comment what I could really understand. Now as soon as somebody understand more he should have the reflex to add comments.
I was always confused by resolve:
Stef
Apparently it is #resolve:
'/tmp/data-dir/' asFileReference resolve: 'a/b/c/file.txt' asFileReference
Way too many methods on the public classes of FileSystem are undocumented.
On 21 Jun 2013, at 16:31, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi,
Does anyone know how I can/should concatenate 2 FileReference paths ?
Given /tmp/my-cache and a/b/data.txt I want to get /tmp/my-cache/a/b/data.txt in such a way that it is a correct, useable path. Next I want to do #ensureDirectory on the parent and write to the file.
'/tmp/my-cache' asFileReference / 'a/b/data.txt' asFileReference
does not work.
'/tmp/my-cache' asFileReference / 'a/b/data.txt'
works but is wrong internally.
I can't figure out the semantics of #,
TIA,
Sven
On Jun 21, 2013, at 11:01 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
I know you did, but it is as you say: this should be done by someone who really understands the design. For example: I learned about #resolve: from comments at the Disk implementation level, not the Public API level where there are almost no commennts. I got into several loops using wrong methods, those should have been marked private I would guess.
I know this is sad but this is the case with most of the code of colin. I did my best to add comments but guessing is always more error prone and stupid trial and error. Anyway we will improve slowly. I do not understand why writing simple method comments is difficult to do when you write the code of the methods. Stef
participants (3)
-
Sean P. DeNigris -
Stéphane Ducasse -
Sven Van Caekenberghe