Changes file without

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

Changes file without

Valentin Ryckewaert
Hello everyone,

I'm trying to execute a script from a .st file on a image whose changes file isn't writable.
When i do this, I'm getting a bug with primSize... It looks like get size of the file need write access ?
The exception :
Primitive failed: primitive #primsize: in MultiByteFileStream

Does someone have an idea of the reason of this problem please?

Valentin
Reply | Threaded
Open this post in threaded view
|

Re: Changes file without

Mariano Martinez Peck
There used to be a #discardChanges or #forgetChanges or some message like that that allowed one to discard .changes file. But I cannot seem to find that anymore in 5.0. Maybe it is #closeSourceFiles.

The reason could be becuase the do-it (same as executing a .st) are tracked in the changes file. Another possibility is to explicitly disable the announcers, hoping that the changes writing happens via announcements:

SystemAnnouncer uniqueInstance suspendAllWhile: [ self executeYourScript ]

Hope this helps.
  

On Tue, May 31, 2016 at 8:22 AM, Valentin Ryckewaert <[hidden email]> wrote:
Hello everyone,

I'm trying to execute a script from a .st file on a image whose changes file isn't writable.
When i do this, I'm getting a bug with primSize... It looks like get size of the file need write access ?
The exception :
Primitive failed: primitive #primsize: in MultiByteFileStream

Does someone have an idea of the reason of this problem please?

Valentin



--
Reply | Threaded
Open this post in threaded view
|

Re: Changes file without

stepharo
In reply to this post by Valentin Ryckewaert
If you execute your script with an image with ui you should be able to
see the stack.



Le 31/5/16 à 12:22, Valentin Ryckewaert a écrit :

> Hello everyone,
>
> I'm trying to execute a script from a .st file on a image whose
> changes file isn't writable.
> When i do this, I'm getting a bug with primSize... It looks like get
> size of the file need write access ?
> The exception :
> Primitive failed: primitive #primsize: in MultiByteFileStream
>
> Does someone have an idea of the reason of this problem please?
>
> Valentin


Reply | Threaded
Open this post in threaded view
|

Re: Changes file without

stepharo
In reply to this post by Mariano Martinez Peck

Thanks mariano

We are trying to find all the places that are writing to disc and others and we should be able to turn them on and off.

Stef


Le 31/5/16 à 14:29, Mariano Martinez Peck a écrit :
There used to be a #discardChanges or #forgetChanges or some message like that that allowed one to discard .changes file. But I cannot seem to find that anymore in 5.0. Maybe it is #closeSourceFiles.

The reason could be becuase the do-it (same as executing a .st) are tracked in the changes file. Another possibility is to explicitly disable the announcers, hoping that the changes writing happens via announcements:

SystemAnnouncer uniqueInstance suspendAllWhile: [ self executeYourScript ]

Hope this helps.
  

On Tue, May 31, 2016 at 8:22 AM, Valentin Ryckewaert <[hidden email]> wrote:
Hello everyone,

I'm trying to execute a script from a .st file on a image whose changes file isn't writable.
When i do this, I'm getting a bug with primSize... It looks like get size of the file need write access ?
The exception :
Primitive failed: primitive #primsize: in MultiByteFileStream

Does someone have an idea of the reason of this problem please?

Valentin



--

Reply | Threaded
Open this post in threaded view
|

Re: Changes file without

Sven Van Caekenberghe-2
In reply to this post by Valentin Ryckewaert
I haven't tried it, but have a look at

PharoFilesOpener>>#unsetInformAboutReadOnlyChanges
  "Make sure the user is *not* informed when the .changes file can not be written to."
  shouldInformAboutReadOnlyChanges := false

> On 31 May 2016, at 13:22, Valentin Ryckewaert <[hidden email]> wrote:
>
> Hello everyone,
>
> I'm trying to execute a script from a .st file on a image whose changes file isn't writable.
> When i do this, I'm getting a bug with primSize... It looks like get size of the file need write access ?
> The exception :
> Primitive failed: primitive #primsize: in MultiByteFileStream
>
> Does someone have an idea of the reason of this problem please?
>
> Valentin


Reply | Threaded
Open this post in threaded view
|

Re: Changes file without

Valentin Ryckewaert
In reply to this post by stepharo
Hello,

Here is a script to make the exception happend

Go where you want the folder to be created and copy paste this:

mkdir testPharo
cd testPharo
mkdir files
cd files
echo Transcript show:'test' >test.st
cd ..
mkdir curl
cd curl
cd ..
sudo chmod -R -w curl
curl/pharo-ui curl/Pharo.image -st ../files/test.st



Execute this to clean what the script did :
cd .. 
sudo rm -r testPharo

Valentin