squeak error: cannot write a read-only file - squeak

I am trying to write a new method in Squeak. I click on the "no messages" to create a new method but any change to the existing template produces the error
"Error: cannot write a read-only file"

Squeak comes with an .image file and a .changes file. You must ensure that both are writable at development time. In particular, each time you save a method it will be written to the changes file.

Related

Loading Excel files with SSIS with different names. Getting error 0x80004005

I have an SSIS package that looks through excel files with a date at the end of each file. I have watched many vidoes but can't find an answer. If I move the "original file" that I used with the connection manager(see link for screenshot) the package fails to complete with "Error: The GetEnumerator method of the ForEach Enumerator has failed with error 0x80004005 "Unspecified error". This occurs when the ForEach Enumerator cannot enumerate." If I then put the file back to the correct place it works again. My question is do I have to have the file there forever? Is there no way to do this and it not look for that file to exist?
You are using static file names. If you are OK with using static file names, then you will have to have some other process update that file periodically. However, if you want to be more dynamic where the process loops over multiple files, then in the ForEachLoop Enumerator, you just set the following settings:
Note: using *.xlsx is the method for getting any file with the extension of xlsx.
You then map the file path to a variable:
You then set your Connection Manager's ConnectionString property to the file path:

Is it possible to configure Serilog to truncate (i.e. make empty) the log file for each new process?

Moving from nlog to serilog, I would like my .NET framework desktop application to reuse a statically-named log file each time I run it, but to clear out the contents of the file with each new process. Is it possible to configure serilog this way?
This is a similar question, but it's not quite the same. In the linked question, the user uses a new log file each time with a unique filename. In my case, I want to use the same log file name each time.
This is not something Serilog can do for you as of this writing.
Serilog.Sinks.File is hard-coded to open the file with FileMode.Append thus if the file already exists, it will always append contents at the end of the file.
FileLifecycleHooks allows you to intercept when the file is being opened, and that would give you an opportunity to remove the contents of the file (by calling SetLength(0) on the stream), but unfortunately the stream implementation that Serilog.Sinks.File uses (WriteCountingStream) does not support SetLength.
Your best bet is to just truncate or delete the log file yourself at the start of the app, and let Serilog create a new one.
e.g.
// Ensure that the log file is empty
using (var fs = File.OpenWrite("mylog.log")) { fs.SetLength(0); }
// ... Configure Serilog pipeline

Error 105 when creating and writing to text file

I am testing a login and account creation program. When the user presses the Create New Account button it prompts them to enter a Username (which saves to a variable-sNewUsername) and a Password (which saves to a variable-sNewPassword).
The password is saved to a text file.
For some reason, it gives me the 'I/O Error 105' when trying to save the password to the text file.
I have run the debug tool and it saves to the variable fine but does not Write to the text file.
I have double checked if I have used Rewrite instead of Reset and all looks fine.
AssignFile(tf,sNewUsername + '.txt');
Rewrite(tf);
writeln(sNewPassword);
closefile(tf);
I expected the file to save the Password from the variable to the text file but it does not write the password to the text file and give an error i do not understand ('I/O error 105').
Your call to writeln is not providing a file object, and so attempts to write to the standard output, which presumably does not exist in your process.
Change it to
writeln(tf, sNewPassword);
However, you should probably use a more modern mechanism to write a file. Further, you are running a serious risk that you won't write the file to the desired directory because you only specify a relative path.

Geocortex Workflow Designer Upload File

i was tring to create a workflow with geocortex workflow designer that upload a file in folder.
So to do that, i create a Form that make a file picker and it returns a IList of FileItem.
than i would take the base64 data and write a file, but it show me an error:
Geocortex.Forms.Client.FileItem.Friend Property FileDataBase64 As
String is not accessible in this context beacause it is 'Friend'
the scope of my variable its Flowchart and i can't understand why this error
this error is showned even if i try to access te variable inside the form activity even outside.
thank's every one
It is probably a security related issue.
Make sure that your target directory is writeable by Geocortex workflow. Do a very basic test.
Again do every steps of the process in isolation, in order to pin-point the source of the problem. Poliart.com

How to execute a file with a different extension's associated application?

In my application, I would like to be able to execute a file with an arbitrary name and extension using the program associated with a different extension.
For example, say I have a file called file.dat, but I wanted to open it with Notepad, as if it was named file.txt or file.dat.txt. Also, I don't have permission to rename the file, so that's out of the question.
If the file were called file.txt, I could call ShellExecute. But that fails when calling file.dat; Windows complains that there’s no association for that file.
I don't want to hardcode a specific executable, because (in the example above) the end user could have associated .txt files with Wordpad instead of Notepad. In such a case, I’d want my file.dat to be opened with Wordpad.
Call ShellExecuteEx and specify the lpClass member of the SHELLEXECUTEINFO struct. Note that you must include SEE_MASK_CLASSNAME in the fMask member.
For instance, set lpClass to '.txt' to request that the file be opened with the program associated with the .txt extension.

Resources