nasm: fatal: Unable to open input file - nasm

I have problems facing assembly on mac. Every time i try to run something it shows an error that unable to open file.
nasm: fatal: Unable to open input file h1.asm
Can anyone tell me an alternate of nasm?

Your problem appears to be with the file you are trying to open, not with the nasm application.
Make sure the file exists h1.asm exists in the current directory that you are running the command from.
For example, if the file exists on the Desktop then perform this:
cd ~/Desktop
nasm -f macho h1.asm
or
nasm -f macho ~/Desktop/h1.asm

Check the extension for the file. If you save that file in windows with h1.asm but forget to change the save as type from text file to all documents, then it will save the file as h1.asm.txt and you will get the same error:
nasm: fatal: Unable to open input file h1.asm
so change the type to all documents.

Related

command prompt says "No such file or directory" but the file exists

I'm having a problem with running files in command prompt, keeps saying "no such file or directory"
I copy n pasted a pathway for an existing file and just swapped the file with the one that im being told does not exist. Tried various small changes in syntax as well.
in text editor:
from sys import argv
script, filename = argv
txt = open(filename)
print(f"heres the file you wanted:{filename}:")
print(txt.read())
print("type the filename again:")
file_again=input("> ")
txt_again=open(file_again)
print(txt_again.read())
in BASH:
python3.7 /users/philipedwards/Documents/ex15.py test.txt
I'm assuming test.txt is in the Documents folder. But, based on this command:
python3.7 /users/philipedwards/Documents/ex15.py test.txt
your current location might not be the Documents directory. By specifying text.txt you're trying to open text.txt from the current directory, not /users/philipedwards/Documents/test.txt.
So, either run the script from the Documents directory:
cd /users/philipedwards/Documents
python3.7 ex15.py test.txt
Or if you don't want to change the active directory, specify the full path of the text file:
python3.7 /users/philipedwards/Documents/ex15.py /users/philipedwards/Documents/test.txt
For futur persons facing this problem. It's maybe because of the binary wich is 32Bits or any incompatible architercture.
Here is an excellent thread referencing the same problem:
No such file or directory? But the file exists!

rcs -u motd breaking a lock

I am trying to use the rcs command to break a lock on a file but whenever I input on ubuntu:
rcs -u motd
it says:
rcs: RCS/motd,v: no such file or directory.
The file is there because I can use the cat command and edit it using vi.
Try rlog motd, which should give you information from the file RCS/motd,v . If that also gives you "no such file or directory", then it's the file motd,v in the subdirectory RCS, which doesn't exist or you can't access.

Opening Exec from different directory

Beginner linux user here,
I want to create an sh file which will open firefox, file explorer and sublime text, rather than execute these commands separately. I have created a bin folder in /home/user and have saved my .sh file there.
Everything runs as I want to except for running the sublime_text executable.
It cannot find the directory as I am running the sh file from the bin directory.
So, my question is, how can I open sublime text from another directory without creating another shell process to do so.
#!/bin/bash
cd /home/user/
./Documemnts/sublime_text_3/sublime_text
xdg-open ~/Documents/sublime_text_3/sublime_text
firefox -new-tab -url https://www.google.com
xdg-open Documents/Work/
I get No such file or directory
or
error: error opening location: No application is registered as handling this file
It looks like the directory on line 2 is misspelled:
./Documemnts/sublime_text_3/sublime_text
Notice Documemnts vs. Documents

Deleting a Non-existing file

First things first:
I have a windows OS.
I use python in Linux (from a USB stick)
I was writing a code in Python that required it to work with Excel...
so once I created it (in Linux) I got a xlwt file created in the D: drive of my computer.
when I booted into windows I wanted to delete the file but it says
The file you specified is not valid or is too long
so I tried deleting it in command prompt(admin) but it says file does not exist!
when I type dir the file gets displayed
so I went in Linux(Kali Linux) and tried
rm -f xlwt
but same problem:
when I say dir in Linux it says xlwt\r
so I said
rm -f xlwt\r
but still the same problem.
In Linux use tab completion to get the correct escaped version of the file name.
Type the following:
rm xlw
Then press the Tab key and the shell will complete the filename with the right escape chars for the '/r'
You should then be able to press enter to delete the file

psql ERROR: could not open file "address.csv" for reading: No such file or directory

A newbie to Linux.
I am trying to copy a .csv into a PostgreSQL database,
copy address from 'address.csv' delimiter ',' csv header;
I have cd to location of file, using the \cd [directory] command at the psql prompt. An unsuccessful action.
I have closed that terminal window and in another terminal window cd to the data folder and from there there I have opened the psql command.
\! pwd displays the name/path of folder where the file is stored.
/home/tommy/virtualenv_folder/code_data/postgresql_csv_files
\! ls displays the file name, even using the wildcard \! add* displays the file name.
stackoverflow.com/questions/16618299/postgres-copy-from-csv-file-no-such-file-or-directory
suggests to reset the search_path. Being in the data folder surely this is not necessary. Or is it?
Anyway, any pointers would be appreciated, please.
You should use the actual path in the copy statement, eg,
copy address from '/home/tommy/virtualenv_folder/code_data/postgresql_csv_files/address.csv'.
Also make sure that the postgres user has read access to that file and directory or change the ownership to postgres, ie, chown postgres:postgres address.csv. I tend to create a directory and give all users read/write access to it, so I can easily load data into postgres and dump it back out again, either as myself or as a postgres user, eg,
chmod a+rw /var/import/postgresfiles
The search_path relates to postgres searching through schemas within the database not in the external filesystem.
Right click on the file, you want to extract data from. click on permission and in the security tab tick the read and write option.

Resources