QNX2 recursive copying? ftp? Delete folders w/files?

I think I can use the backup command to recursively copy directories, subdirectories, and their files to a new location, without having to manually create all the new directory paths in the target location. I’ll need to play around with some of the options to cater it to my uses, but I still have a couple adjacent questions.

For copying files to a destination where the target directories and subs do not yet exist;

  • Is there any way to do this with the CP or COPY commands?
  • Is there any practical way to do this via FTP?

I am not intimately familiar with the QNX environment yet but I’m learning a little more every time I dig into things.
The software we run is built on an instance of QNX2.21. The software has a pretty decent file manager and also automates some aspects of FTP transfer of data captured within the software, but I’m fairly certain the devs never really anticipated anyone to be bumbling around in the background within QNX…

My job isn’t so much to use the software for its intended purpose, but rather to maintain the machines, so I’m trying to get a handle on how best to backup the important components of the software and find a method to streamline the process.

(also, is it possible to delete a folder and its contents, or do I have to individually delete individual files first? I figured just blindly pointing rmdir at a directory might work, but since QNX has such funky file handling, I wasn’t sure if that would leave some kind of remnants that might screw something up)

[yes it’s old, no the software doesn’t exist on any other platform, yes it will eventually be replaced but that process is very slow so these machines need to be supported/understood/maintained for at least another ten years… I’ve actually built fresh replacement machines from new industrial pentium-4 boards with ISA slots so we have some physical hardware replacements ready to swap out when/if any of the old machines fully fail]

I think I can use the backup command to recursively copy directories,

subdirectories, and their files to a new location, without having to manually create all the new directory paths in the target location.

Yes, e.g.:

$ backup /dir1 /dir2 +a

In case you don’t know, most QNX 2 commands have some internal documentation that you can get this way:

$ backup

For copying files to a destination where the target directories and subs do not yet exist;

  • Is there any way to do this with the CP or COPY commands?

Not a good idea. You would need to make the directories with mkdir and copy each directory one at a time. Use backup.

  • Is there any practical way to do this via FTP?

I really don’t know what you are thinking here. FTP is not native to QNX 2. There were 2 or 3 implementations, at least two of which were specific to a piece of hardware. QNX 2 TCP/IP was not at all standard and limited in a number of ways. So any questions about ftp will have to be for a specific implementation.

Now ftp has the capability to upload or download a directory recursively, but you really don’t want to to use it locally.

I am not intimately familiar with the QNX environment yet but I’m learning a little more every time I dig into things.

The original documentation can be found online if you know where to look. That can help.

The software we run is built on an instance of QNX2.21. The software has a pretty decent file manager and also automates some aspects of FTP transfer of data captured within the software, but I’m fairly certain the devs never really anticipated anyone to be bumbling around in the background within QNX…

QNX 2.21 was the last release. When you say file manager, are you running under QNX WIndows? There were a few text menu interfaces.

My job isn’t so much to use the software for its intended purpose, but rather to maintain the machines, so I’m trying to get a handle on how best to backup the important components of the software and find a method to streamline the process.

Unless you can run your application on a VM, you are in a world of hurt when it comes to hardware. I’m about to unload a lot of archaic hardware that has accumulated over the years so you may want to contact me about this. maschoen@pobox.com.

I’m also one of the few remaining experts with QNX 2 in case you need some kind of support.

(also, is it possible to delete a folder and its contents, or do I have to individually delete individual files first?

I don’t recall whether “erase” has a recursive version, but I doubt it. I think my own method was as follows.

  1. Use the “files” command to create a text file with a list of files.

  2. Use ed to edit the file and put "erase " in front of each file name.

  3. Run the file as a script

  4. Repeat using the +d (directory) and add “rmdir” to each directory name.

You may have to run this script a few times to get everything.

There may be a utility that does this more directly, but I don’t recall.

I figured just blindly pointing rmdir at a directory might work, but since QNX has such funky file handling, I wasn’t sure if that would leave some kind of remnants that might screw something up)

I’m quite sure that rmdir will only delete one directory, not files recursively.

If you are brave you can run “zap” and then “chkfsys”. Zap removes a directory and all its descendants from the file system without reclaiming the sectors. Chkfsys checks the file system and finds any lost sectors. You don’t want to run chkfsys when you have any open files.

[yes it’s old, no the software doesn’t exist on any other platform, yes it will eventually be replaced but that process is very slow so these machines need to be supported/understood/maintained for at least another ten years…

Ouch. You should put me on retainer. That’s going to be a tough one.

I’ve actually built fresh replacement machines from new industrial pentium-4 boards with ISA slots so we have some physical hardware replacements ready to swap out when/if any of the old machines fully fail]

So, here in a nutshell is my recollection of problems you will have running QNX 2 on a pentium. There’s a utility to fix a bug with the floppy driver on fast cpu’s. Without going into details, I don’t know if it will work on a Pentium. It probably depends on the speed. I don’t know if you need a floppy, but it’s pretty tricky to run QNX 2 without one.

If you are using QNET, there is a race condition that will cause you to lose virtual circuits. You can just reboot if that is feasible. There was a utility that was supposed to clean things up and I never got it to work.

Good luck

One last thing occurred to me. You should probably check out the “eo” execute on command. It may help doing recursive deletes. I never really got to know it all that well.

It is more than 25 years I haven’t use QNX 2.21 and in the late 80’s this was the best OS of its time. I still have it running on Virtualbox.

  • cp cannot recursively copy files, you have indeed to use backup for that. However cp supports wildcards, you can do ‘cp *.c /usr/dest-dir’
  • you can find the manual in PDF format of the QNX 2.21 OS here - WinWorld: QNX 2.2
  • One solution for TCP/IP support for QNX 2.21 was from a german company: André Koppel Software: Specialists for realtime software and embedded systems: TCP/IP - Kommunikationstools (akso.de). It still exists today. I’ve used it to migrate from QNX 2.20 to Windows NT 4.0 back in 1998 and it worked well with the PCI card even PCI was never supported on QNX 2.20 by QNX.
  • I have a file manager in console mode called EZ-File manager that is really great.

@masheon. There was a windows system (open look look&feel) for QNX 2.20. I had the install disks when i worked for the company in the late 80s. Unfortunately I did not take the install floppies with me when I left the company. Do you know where I can get a copy of the install disks.

Pascal

I forgot to mention that rm can remove directories and their content recursively with:
rm +r mydir
You can see all options by typing:
rm ?

Thanks for the input thus far. Maschoen, you’ve already been an asset to a previous colleague (“grovebaby” here on the forums) who has since retired, as well as myself. If it ends up that we actually need to build some stuff in QNX itself, I may have to talk to one of my superiors about the idea of actually commissioning you for deliberate help. For now, my dabbling is really just a personal effort to understand the backbone of these machines better… I can almost guarantee nobody here in our facility has really spent more than an hour or two with the actual QNX portion of these machines in the +30 years they’ve been here in operation.

At the moment, I feel like most of my hurdles are general usage/understanding since QNX is just a completely foreign environment (as a kid, I cut my teeth on dos and win 3.11 with 386/486 stuff, so I’m at least generally familiar with wrangling hardware to get it to behave with old software).

VM is unfortunately impractical, but thankfully the P4 machines I’ve built seem to load and run our software just fine after configuring the bios appropriately, I’ve also not encountered any issues with floppy access, though I had seen prior comments about it here on the forums.

Since the software we’re using was a complete package that included QNX as its backbone, I believe the devs had already catered it for versatility across different machines… for example, I recall reading something about throttling QNX in a case where the CPU may just be faster than it needs… the sys.init file has a comment that reads

" * QNX2 uses a 16-bit uint to store the CPU speed index.  On faster *
" * machines, the value can wrap around because it will exceed 66535 *
" * (max uint).  So, force the CPU speed index to be 65535.          *
/cmds/speed_correct

with a bunch of other configuration options further down the file. Unfortunately I don’t have a background in basic coding/scripting; I can infer what a lot of the commands are and how the syntax works, but my brain isn’t wired to actually grasp it without spending time poring over documentation and fumbling through trial and error. Everything I’m invariably tasked with is trial-by-fire so I don’t quite have the opportunity to follow as many threads as I’d like right now.

No this is a program/container (not sure what it would technically be called) that still operates in the ascii text based display, but formats the whole screen as a file browser and has commands mapped to F-keys and other keys to enable help, search, sorting, delete, copy, etc etc. It’s kinda like a very crude win3.1 file manager. It’s part of the software bundle, presumably to aid in navigating and copying files, automating a lot of what would otherwise be shell commands. They also include an instance of DFS so there’s at least some dos compatibility.

There’s also a gui provided but it has never been configured or put to use anywhere here in our facility, it also doesn’t seem to have the same kind of versatility as the regular text-mode interface that we typically use for running tests and taking data. I managed to wrangle a screenshot of it:
SCN5
sadly I can’t find a serial mouse anywhere even in the darkest corners of forgotten rooms in the building, but there’s still some slight keyboard navigation available.

The normal software interface is all text-mode, utilizing box-drawing characters to make a sort of hierarchical menu style navigation for setup/navigation/etc.

[quote=“psimler”]It is more than 25 years I haven’t use QNX 2.21 and in the late 80’s this was the best OS of its time. I still have it running on Virtualbox.

  • cp cannot recursively copy files, you have indeed to use backup for that. However cp supports wildcards, you can do ‘cp *.c /usr/dest-dir’
  • you can find the manual in PDF format of the QNX 2.21 OS here - WinWorld: QNX 2.2 [/quote]

Yeah, it seems like my hands are tied, i may have to figure out how to craft some of my own commands to run as scripts and automate certain steps (like check destination for directory X, if not present then create, then copy, etc etc… not sure how practical any of that might even be, but until I know my limitations, anything is possible lol).

I’ve already printed and bound a couple copies for both myself and an engineer in our lab of the QNX 2 manual, commands manual, and the manual for the full-screen editor. I’ll definite bookmark that link though, anything that gives me more resources and examples.

I’m not certain whether i could be justified in buying any license(s) for that utility given that the only FTP functions our facility relies on for transferring logged data work fine for their original purposes. I’m more interested in FTP as a venue for broader data transfer and management since I will have to backup and maintain these machines; I may be able to make some kind of jury-rigged solution with scripts once I have a better understanding of the OS in general, or I may even find a better option that doesn’t use FTP.

Funny that you mentioned it has PCI support because there was a brief moment where I was attempting to dupe our software into looking at interrupts and ram locations for PCI versions of the two ISA cards that we utilize, but i couldn’t ever get it to fully access the hardware.

I’d be curious to see this, I couldn’t find anything with the briefest of google searches. Is it available on the openqnx page here?:

{edit: nevermind, I realize those are all Neurtrino things, not for qnx 2 I assume}

Does it look like this? This is Midnight Commander which was and still is a popular text based file editor.

Tim

kinda, but not quite the same… I’ve used ftp clients on windows and old macs that had a commander-style interface, I like the dual browsing halves of the screen (my modded classic Xbox had a file manager that was similar, too, now that I think back on it), but this manager was a bit different.

I can’t take photos inside the facility per company policy, and screenshots in text-mode just output text files instead of an actual image, so I colorized the text files on my desktop machine and cropped them…

Here’s what the normal display would look like, stretched 640x480:
afm colored
The two columns are just halves of one whole scrolling list; if I were to scroll down further past “disp_tags.i,” the “menu” directory would wrap over to the bottom of the left column. (note: I forgot to colorize the selection bar when I was on an item in the list, but the line would basically just appear as inverted colors, ie: grey background and blue text characters)

it also has the ability to view files in both ascii text mode as well as hex, with three display modes; 25 line, 43 line, and 50 line… here is an example of the data from the first few lines of the actual file manager application file itself in first ascii then hex, 25 line:
ascii25

ascii view
these are all using the normal windows “terminal” font so it’s not a one-for-one replication.
The ascii viewer is good for basic text files obviously, the hex dump potentially serves varying purposes but not much for my needs outside of being able to see plain text buried in the code.

It has other capabilities outlined in the help file. You can also specify ten separate macros that can be executed within the file manager… this is another feature that nobody in the facility has probably utilized beyond very basic necessity; it might make some copying commands a little more versatile but the field for a single macro only allows for a maximum string of 70 characters

I think that you are referring to QNX Windows, the first graphical windows front end for QNX. I may have a manual around and I really wish I had install disks. There were two distinct product, a run time and a development system. I believe I only had the run time and I don’t have it running anywhere.

A while ago Antoni Sawicki was archiving QNX 2. You might want to try contacting him at as@tenoware.com

Here are some screenshots of the EZ file Manager on QNX 2.20. It is kind of Midnight Commander. By the way you can do a ‘stty rows=50’ to get a console with 50 rows instead of only 25.

@ bananaman: you mentioned the speed_correct utiliy. There was as well a speed_patch utility that patched the boot file and by doing so only once you had not to call speed_correct on each reboot

You found the utility “speed_correct” that maximizes the likelyhood that the floppy driver will work. As you point out, some bios’s have/had the ability to slow down the cpu, I think by disabling the cache. The graphic screen you posted does look a bit like I remember QNX WIndows, but it also looks like MS Windows.

I may have a serial mouse or two around. Recall that I’m going to be purging equipment in the next few months.

A side note, I used to get emails from openqnx when someone responded, but I’m not getting them now. You should ping me at maschoen@pobox.com if you want me to see something quickly.