EJC: How many slashes (subdirectories) are allowed for source files?

Anything QL Software or Programming Related.
Post Reply
User avatar
ql_freak
Super Gold Card
Posts: 503
Joined: Sun Jan 18, 2015 1:29 am

EJC: How many slashes (subdirectories) are allowed for source files?

Post by ql_freak »

As I now have a fully working (USB-)floppy disk drive on my main (Windows 10) machine (Win10 unfortunately doesn't support native PC disk drives), I have installed EJC.

Is there anyone who has experience with EJC? I have already compiled a first "Hello, world!" program successfully. Now I want to write another program for testing EJCs val(...) function. The "Hello" program is stored in "WIN1_home_abcd_xyz_c_" under the name "ehello_c' and compiles OK. For the program I want to write now, I created a directory "WIN1_home_abcd_xyz_c_qalc_" and the source file "qalc1h_c" in it. When compiling I get the error message:

Error in pass 1 when compiling WIN1_home_abcd_xyz_c_qalc_qalc1h (Listing file is empty).

If I copy qalc1h_c to "WIN1_abcd_xyz_qalc_" and compile it there, it is OK and an executable file is produced. Strange.


p.s.:
You may ask why anyone wants to use EJC, when we have the excellent C68. Well EJC, which is not free, cause it uses (patched versions) phase 1 and 2 from the commercial Lattice C compiler - which I have had bought long ago (horrible expensive for a student like me at this time) - which is unfortunately still not free, has one very big advantage. The Lattice compiler was always capable of producing reentrant, even ROMable code. Unfortunately the libraries delivered with Metacomco-C (they delivered Lattice-C for the QL) never supported this (but it is documented in the manual for the compiler switches). Erling Jacobsen (Denmark) has written libs and initialisation code (AND has patched the compiler phases 1 and 2), so that his EJC produces reentrant, ROMable code (and functions like printf(), floating points, ... are suppoorted!). In fact it is a full K&R compiler for the QL which produces reentrant, ROMable code. The only restriction is the size of the program. As the 68000 only supports PC-relative branches of +/- 32 KBytes the size of EJC-programs is limited to a maximum of 64 KBytes (at least if the code should be reentrant and ROMable - albeit I'm not absolutely sure).


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Derek_Stewart
Font of All Knowledge
Posts: 4736
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: EJC: How many slashes (subdirectories) are allowed for source files?

Post by Derek_Stewart »

Hi,

I had a downloadable version of EJC on my old BBS, I think it was sent through the FidoNET as well. So was this in breach of copyright.


Regards,

Derek
RWAP
RWAP Master
Posts: 2893
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: EJC: How many slashes (subdirectories) are allowed for source files?

Post by RWAP »

What is EJC?


User avatar
tofro
Font of All Knowledge
Posts: 3115
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: EJC: How many slashes (subdirectories) are allowed for source files?

Post by tofro »

To answer the actual question:

There is no specific limit, to my knowledge, to the depth of "subdirectories" (i.e. the amount of "_" characters in a filename), neither in standard QDOS nor its descendants.

There is, however, a length limit built into QDOS and all descendants due to some hard limits designed into the operating system: A path name's overall length (including device name, number, and all characters of the actual file name and directory designation) cannot be longer than 40 characters. If you use longer names, all sorts of havoc can happen (and your examples seem to be close to that limit).

Even if the names you actually use might not be longer than that limit, it might very well be that your compiler tries to generate intermediate file names that exceed the allowed length.

The actual limit is imposed by the channel definition block structure that is used to communicate between the operating system and the device drivers. It basically results in the fact that the system cannot communicate longer names to its device drivers.

And, somewhat reverting what I wrote above, as a consequence of the limited length of a path name, the directory depth is actually limited to around 16 (when you use single-character directory names).

Tobias
(Who sometimes still uses PDQ/Metacomco C for the exact same reason you do)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
pjw
QL Wafer Drive
Posts: 1623
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: EJC: How many slashes (subdirectories) are allowed for source files?

Post by pjw »

tofro wrote: <>
And, somewhat reverting what I wrote above, as a consequence of the limited length of a path name, the directory depth is actually limited to around 16 (when you use single-character directory names).
I get 18, or 17 functional, directories:

Code: Select all

100 x$ = 'x_'
110 CLS
120 FOR n% = 1 TO 99
130  MAKE_DIR 'ram1_' & x$
140  PRINT n%! LEN(x$)! x$
150  x$ = x$ & 'x_'
160 END FOR n%
170 :


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
tofro
Font of All Knowledge
Posts: 3115
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: EJC: How many slashes (subdirectories) are allowed for source files?

Post by tofro »

pjw wrote:I get 18, or 17 functional, directories:
I knew someone would be nitpicking :D

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
NormanDunbar
Forum Moderator
Posts: 2483
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: EJC: How many slashes (subdirectories) are allowed for source files?

Post by NormanDunbar »

16 or 18 characters? That's news to me!

I remember many years ago, testing the recursion in WinBack on a Miracle Hard Drive, and had a working backup of a single character file, called zz, at the bottom of a directory tree, something like win1_a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_zz.

There are 36 characters for the file path, which includes the directory tree plus the file name plus all the underscores after the 'a' avove, but not including the device name or any network name either. The device takes 5 characters, 'win1_' and the network takes some more for 'n2_' but I'm not sure shat the highest net station is at the moment.

Cheers,
Norm.

Ahem, maybe you meant 18 characters not including underscores in the path? If it's single character directors and file names, then it's a total of 17. With single character names as above, your directory structure allows for files with 2 characters in the name and no extensions. But I'd hate to be quoted on my memory of code I tested back in the early 1990s!


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply