I always used Windows to work with Clipper and Harbour.
For some reasons I must jump in Harbour on Linux. These days I have installed Ubuntu Server 20.04, and somehow I succeeded. Up to now I login only with user I defined in installation process, so I think that it is root user, or it is not ?
Then I found on internet how to install Harbour from git sources. I used this link:
And full list of dependencies I found on this link:
https://ubuntuforums.org/showthread.php?t=2035652
According to first link I placed Harbour sources under /opt/TuxPrograms/trunks directory. Whole installation process of Harbour succeeded.
After that I created /data folder, just under / (root) directory. In that folder I copied some file TEST.DBF. I must say that all commands I typed with sudo ... up to now I do not know how to create another ordinary (non super) user. Then in same directory I made test.prg:
CLS
?"FILE = ",FILE("TEST.DBF")
?"CURDIR = ",CURDIR()
USE TEST
QUIT
At the end I used hbmk2:
sudo hbmk2 test.prg // commands do not work without sudo ...
Compilation successfully finished, no errors. At the end I started test with:
./test (also tried with sudo ./test, same errors)
As a result on tty screen I got:
FILE = .T.
CURDIR = data
DBFNTX/1001 Open error TEST.dbf (DOS Error 2)
All is logical except in USE command !? Here I stopped. I do not know what to do. I read many threads but did not find this particular situation. I tried with sudo chmod –R 755 /data, but no success.
Please if someone can advice me what to do.
-Why this happened ?
-Is there are better place for Harbour ? Some people says that it is better to place it in /usr/local directory.
-I will appreciate if you can give me some other advices on how to work with Harbour on Linux, where to place Harbour, where to place PRGs, where to place DBFs.
Thank you in advance.
Best Regards,
Simo.
The user that you created on installation is the owner, and has similar permissions to root, but is not root.It is preferable not to place data files in the root file system. Create a secondary file system for applications and data.
To begin with, set all data files (.dbf, .idx, .ntx, .cdx, etc) to 0666 (read write by all). Set directories to 0777 so that users can create new or temporary data files.
You can fine tune this when as you get a better feel for Linux.
Create another user to do testing.
Move hbmk2 and hbrun to /usr/local/bin
if users can compile programs and have "dot prompt" access to data.I usually use the following directory structure:/u/myapp/srcexedbfidx
tmpinputoutputworkksh (or bash)
Also Linux file names are case sensitive. TEST.dbf and test.dbf are not the same file.
Hi.
In short, nothing changed.
USE TEST still gives DBFNTX/1001 Open error TEST.dbf (DOS Error 2).
Tried also with USE TEST READONLY. No changes.
FILE("TEST.DBF") gives .T.
In my example TEST.DBF is in upper case. I tried also with test.dbf, no changes.
I created /data/sdata directory and moved all files to that subfolder. In that sdata subfolder I have:
TEST.DBF
test.prg
test (executable, created after hbmk2 test.prg)
I set TEMP.DBF to 0666. I set directory data and data/sdata to 0777. Also changed ownership from root to user beta (beta is my user created in installation process).
I can't beleive that this simple example do not work !? All files are in one directory. No need to write only to read TEST.DBF.
Note: Harbour is 3.20dev (r2009190002). Hbmk2 and other progs are already in /usr/local/bin .
May be to switch from Ubuntu server to Ubuntu desktop ?
Best Regards,
Simo.
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/787e8ddb-dd25-44bb-8c81-4e57b68aa9bcn%40googlegroups.com.
--
Hi Francesco.
Lowercase file name did the job !
I changed TEST.DBF to test.dbf . All next commands worked:
USE ("test.dbf")
use ("test.dbf")
USE ("test")
use ("test")
Well, I must remember golden rule: In Linux keep all filenames in lowercase !! Did not expected that it is so important.
Thank you all.
Best Regards,
Simo.
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/ae761882-46cb-1e63-24e2-dd303c495612%40engwall.com.
Hi Klas.
Thank you for your information.
In Windows I do not care about file names as all works same no matter
how I name my files. It is good to now these settings and compiler switch when
migrating to Linux.
I will try it also.
Best Regards,
Simo.
Hi.
One
last question, if you have any patience with me.
I
can USE("test.dbf") when test.dbf is in same directory with executable
file (I call it current directory).
But
I can't open file that is not in current directory. For example this
USE("/data/sdata/test.dbf")
do
not work. It gives DBFNTX/1001 Open error TEST.dbf (DOS Error 2). I for sure
have test.dbf in /data/sdata directory.
Also
FILE("/data/sdata/test.dbf") return .F. This works in Windows without
ant problems.
I
tried with backslash USE("\data\sdata\test.dbf")
, again same error.
Is
there some Linux rule for opening file that is not in current directory, using
Harbour ? Linux do not have drive letter C: or D: as in Windows, so how can I
type type paths (absolute or relative) in Linux?
Best Regards,
Simo.
Hi.
Sorry
to all. My mistake in last question. I
work all day, so I am tired.
USE("/data/sdata/test.dbf")
works good.
In
beginning of my prg I forgot that I
tested
SET
FILECASE LOWER
SET DIRCASE LOWER
When
I commented these SET commands, all works well. I did not use SET commands correctly.
Again
thanks for all who gave me suggestions and guided me in Linux matters. No more
questions.
Best Regards,
Simo.
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/cac51eb2-0c01-4d58-9dd0-ec13ae68aa54n%40googlegroups.com.