Hi Enrico, > The function works if I rewrite get_f_node() in the following way: ... > for(i = 0; i < NFILES; i++) ... > if(f_nodes[i].f_count == 0) ... > return &f_nodes[i]; ... > This was the implementation present in the source tree four years ago.
The difference in the current implementation is that we now have a "cache" with two "near" fnodes in the kernel data segment. That way, fewer far pointers are needed, but several functions got more complicated. For example get_f_node. The other difference is that you use NFILES instead of a configurable number set by FILES=... in config sys :-). > [after] dos_cd ("C:\hello\world"); > dos_open ("C:\hello\world\my_file.txt", O_RDWR | O_CREAT, 0); [ok] > dos_open ("my_file.txt", O_RDWR | O_CREAT, 0); [fails] As discussed earlier, dos_open is a bit "lowlevel" if you look at DosOpenSft, you will find that it calls truename. The truename function does things like add the current drive letter and current directory name, resolve ".." and ".", and make name handling case insensitive. As with your previous upper / lower case problem, the solution is again to use more truename code in your dos_open. > I noticed that the implementation of dos_cd() doesn't write or read CDSp > of the drives... That might be an explanation for why directory access sometimes fails with SUBST drives or similar? I seem to remember that we have a bug report about this in Bugzilla, please check! Eric PS: findfirst / findnext use special data structures. You first put your query in a buffer, then call findfirst, and to get followup results to the same query, you repeatedly call findnext. A bit ugly but we have to be MS DOS compatible :-p. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel