Unable to use os.Mkdir() on Mac OS - macos

I'd like to start off by saying this was working yesterday and to the best of my knowledge my computer has not performed any updates in the last 48 hours.
The program I am writing executes this code:
createDatabasesFolderError := os.MkdirAll("./.minutesdb/databases", os.ModePerm)
checkErr(createDatabasesFolderError)
Which results in this error when running go run .:
2020/10/28 08:04:58 Error: mkdir /.minutesdb: read-only file system
exit status 1
Running pwd results in this:
/Users/garrettlove/development/goworkspace/src/github.com/garrettlove8/minutesDB
I thought this was an OS issue as opposed to a Go issue, however everything else on my computer works, including other coding stuff...

You code's path - as quoted in the question - I suspect is a typo:
os.MkdirAll("./.minutesdb/databases")
as it does not match the logged error path /.minutesdb (missing the leading dot):
2020/10/28 08:04:58 Error: mkdir /.minutesdb read-only file system exit status 1
The error describes, understandably, a non-root user cannot write to the root / of the filesystem.
Add the missing leading dot to fix the path issue.

Related

Problem running package in directory with whitespace on windows 10

Through the terminal I ran
yarn create xxxxxxx-app in a directory that had whitespace in the URL, but it failed because it couldn't understand the complete URL. So I changed to a directory that didn't have any spaces in it to run the same command and it failed using the same internal path as the previous.
The package installs the scripts and binaries where it should but when it tries to run them, it tries to use the original URL that has the whitespace and fails
Example in a directory with or without whitespace:
runs: C:\Users\First Last\AppData\Local\Yarn\bin\xxxxxxxxx-app
"C:\Users\First" isn't recognized as an internal or external command,
error Command failed.
So internally it uses the same command as the one that failed orginially even though it was run in another directory
both respond as follows:
Exit code: 1
Command: C:\Users\First Last\AppData\Local\Yarn\bin\xxxxxxxxxx-app
Arguments: ./xxxxxxxblog
Directory: C:\Users\First_Last\Github\David-Ventures1
I found that the problem is that the package uses my user account no matter where I try to run the script, and unfortunately my user directory has whitespace in it.
So I need to remove the whitespace.... I tried a couple of times a little while ago but nearly bricked my computer...

ls command does not work in VxWorks target prompt

I am new to vxworks and getting the problem after loading the VxWorks image from host machine to target machine. After loading the image at target machine(including build in symbol table), I am getting issue in commands cd, ls etc. cd command is getting success but while executing ls command after the cd it shows error as value = -1 = 0xffffffff(print error code as 0x3d0004). I am not able to resolve the issue after a lot of tried in building the VxWorks images. Request anyone to please help in this regard. I am also not sure whether the cd command is executed successfully or not since I am not able to see any FTP message on the network while executing the CD or LS command.
Thanks
Vaibhav
Propably the initial directory is not set. Try changing to one of the drives of your machine (e.g. cd "/tffs0") before using ls or commands like that.
To obtain a list of all available devices type devs.

install4j: Executing bash file

I am trying to run a bash file from install4j6. install4j does indeed try to run the bash file but it just returns an error at the end of the installation. The error is very generic and has no code reference or anything that will help me determine a solution - just a message that says "Error while executing file."
The only thing I can provide is how I have it setup in install4j6 since I am pretty sure that's my issue.
The bash file is defined in the root of my installation directory distribution tree and is named set_permissions.sh. For the sake of eliminating permissions being a cause, the file permission mode is set to 777 (both in install4j and on the file system).
I believe the issue is related to what I have set as my "working directory". I currently have it set to just ".". Is there a way to debug this further? Maybe get an actual error as to why it's not executing?
Ok, first a few things to check:
make sure that you're running the batch file after the install files step (you mention it being at the root of your install)
best to have the wait for termination checked and a variable for the return code.
redirect stderr to the log file (just in case)
As for working directory, . should work, but you can change it to ${installer:sys.installationDir} to make sure that it references the installation directory chosen by the user. You can also set the executable in the form of ${installer:sys.installationDir}\set_permissions.sh
Also, try and run just your shell script to make sure that it works :)

TCL file not found by NS2 in MAC OS X Mavericks

I have just installed NS2 on Mac OS X Mavericks (10.9)
I have set all the paths correctly.
I can successfully type 'ns' on the terminal, and 'nam' as well, and both execute without any problem.
The problem is that when I input a file to the ns command, it says:
couldn't read file "example.tcl": no such file or directory
I use this command in the terminal:
ns example.tcl
I also tried it running it in sudo mode:
sudo -s
ns example.tcl
I placed the file in the bin folder, where there's ns's shortcut, I also placed it where actually the ns is. I also tried giving it a full path to the tcl file, but no use in both the cases.
I also tried to run it after executing only ns first, and then within ns ran it (No idea if it works like this, I am just trying everything I have got!)
ns
%ns example.tcl (Hash sign shows the NS is running and I am typing the command there)
This time the error is:
warning: using backward compatibility mode
error when calling class OldSim: hello-ddos.tcl
The version of NS is 2.35.
NOTE: I changed the file extension from .tcl to .txt, and it works fine now. Any idea of the problem?
Please help!
The error message:
couldn't read file "example.tcl": no such file or directory
is pretty clear. It simply couldn't find the file; the OS returned an ENOENT error from the underlying system call to open the file. The usual reason for this is that the file isn't in the directory that you're running the program from, and the usual recommendation for dealing with this is to use the full name of the file instead of just the local path-less version. (It's technically possible for there to be other issues, but they usually produce different errors.)
What can cause this? Well, one of the most common things is if you (or some library code, such as what is inside NS2) does a cd to change the current directory. Using a full, absolute filename makes (or at least should make) your code much more resistant to that sort of thing.
Warning: note that the second part of your question relating to changing the filename is strange to me.
Check the directory of your file. It should be in the bin folder inside your ns folder.
Also you may try typing
sudo ./ns filename.tcl
to give you root access if by any chance you are detached from that.

Something incorrect in shell path/syntax

I'm trying to instal Extension:Scribuntu, but when I try to run simple command, like #invoke I get the error:
Lua error: Internal error: The interpreter exited with status 127.
This is what I found in error logfile:
sh: /var/lib/php-exec//sh /alt/home/webmaster.plast/html/Wiki/extensions/Scribunto/engines/LuaStandalone/lua_ulimit.sh 7 8 51200 \\/alt/home/webmaster.plast/html/Wiki/extensions/Scribunto/engines/LuaStandalone/binaries/lua5_1_5_linux_64_generic/lua\: No such file or directory
So my question is: can You tell me if the paths are correct? I've checked the files and they are all in place. Paths also are absolute so I have no idea where the problem is. Are those "\" before path correct?
I have never used shell before so i don't even know the correct syntax. Thank You for simple explanation.
There should be no "\" in the path, but it's possible that this is an artifact of the error reporting/logging machanism. Do check though.
Another thing to check is that the user executing the code actually has the permissions needed to read and run the lua executable (and the directory where it resides, and all parent directories). For apache under Debian or Ubuntu, that user would typically be www-data. It should be fine to make the lua executable readable and runnable for all users.

Resources