open file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

open file

Juan-2
Folks

There any way to open a file in the gemstone?
GsFile openRead: aPathName and frinds fail
the file is allways nil.
TIA

best regards
MDC
Reply | Threaded
Open this post in threaded view
|

Re: open file

Dale
Juan,

FileDirectory and ServerFileDirectory can be used to access the file system in GLASS ...

FileDirectory should be used when you want to access the file system relative to the process running your GemTools image (or client machine).

ServerFileDirectory should be used when you want to access the file system relative to the stone process (or server machine).

FileDirectory uses GsFile>>open:mode:onClient: where the arg to onClient: is true.

ServerFileDirectory uses GsFile>>open:mode:onClient: where the arg to onClient: is false.

My guess is that you are using a server-based path in your calls to GsFile class>>openRead: if so, #openReadOnServer: would be the right message to use.

Dale
----- "Juan" <[hidden email]> wrote:

| Folks
|
| There any way to open a file in the gemstone?
| GsFile openRead: aPathName and frinds fail
| the file is allways nil.
| TIA
|
| best regards
| MDC
Reply | Threaded
Open this post in threaded view
|

Re: open file

Juan-2
Dale

Thanks for rapid response.
Dale my tests file
i 'm evaluating

| da |
da := GsFile openReadOnServer: '/home/glass/repo/carla-05-02-2010.1.cs'.
da close.

close fail because da is nil .
i'm doing something wrong?
Best regards
MDC


On Fri, Feb 12, 2010 at 2:52 PM, Dale Henrichs
<[hidden email]> wrote:

> Juan,
>
> FileDirectory and ServerFileDirectory can be used to access the file system in GLASS ...
>
> FileDirectory should be used when you want to access the file system relative to the process running your GemTools image (or client machine).
>
> ServerFileDirectory should be used when you want to access the file system relative to the stone process (or server machine).
>
> FileDirectory uses GsFile>>open:mode:onClient: where the arg to onClient: is true.
>
> ServerFileDirectory uses GsFile>>open:mode:onClient: where the arg to onClient: is false.
>
> My guess is that you are using a server-based path in your calls to GsFile class>>openRead: if so, #openReadOnServer: would be the right message to use.
>
> Dale
> ----- "Juan" <[hidden email]> wrote:
>
> | Folks
> |
> | There any way to open a file in the gemstone?
> | GsFile openRead: aPathName and frinds fail
> | the file is allways nil.
> | TIA
> |
> | best regards
> | MDC
>
Reply | Threaded
Open this post in threaded view
|

Re: open file

Dale
Juan,

GsFile class>>lastErrorString should provide the unix-style error message:

| da |
da := GsFile openReadOnServer: '/home/glass/repo/carla-05-02-2010.1.cs'.
da isNil
  ifTrue: [ ^da error: GsFile lastErrorString ].
da close.

Dale

----- "Juan" <[hidden email]> wrote:

| Dale
|
| Thanks for rapid response.
| Dale my tests file
| i 'm evaluating
|
| | da |
| da := GsFile openReadOnServer:
| '/home/glass/repo/carla-05-02-2010.1.cs'.
| da close.
|
| close fail because da is nil .
| i'm doing something wrong?
| Best regards
| MDC
|
|
| On Fri, Feb 12, 2010 at 2:52 PM, Dale Henrichs
| <[hidden email]> wrote:
| > Juan,
| >
| > FileDirectory and ServerFileDirectory can be used to access the file
| system in GLASS ...
| >
| > FileDirectory should be used when you want to access the file system
| relative to the process running your GemTools image (or client
| machine).
| >
| > ServerFileDirectory should be used when you want to access the file
| system relative to the stone process (or server machine).
| >
| > FileDirectory uses GsFile>>open:mode:onClient: where the arg to
| onClient: is true.
| >
| > ServerFileDirectory uses GsFile>>open:mode:onClient: where the arg
| to onClient: is false.
| >
| > My guess is that you are using a server-based path in your calls to
| GsFile class>>openRead: if so, #openReadOnServer: would be the right
| message to use.
| >
| > Dale
| > ----- "Juan" <[hidden email]> wrote:
| >
| > | Folks
| > |
| > | There any way to open a file in the gemstone?
| > | GsFile openRead: aPathName and frinds fail
| > | the file is allways nil.
| > | TIA
| > |
| > | best regards
| > | MDC
| >