Creating a directory

15 views
Skip to first unread message

J. Patrick Harrington

unread,
Apr 29, 2026, 2:48:20 PM (8 days ago) Apr 29
to fo...@jsoftware.com
I have a program that needs to create a directory into which I later write a bunch of files. I just used mkdir=: 1!:5@< . However, sometimes the directory already exists, which results in an error. I would like to just have the program continue if the directory exists. It is probably obvious,
but how do you check whether a directory exists?

A different issue: I have a program which creates and uses huge arrays. I have to limit the size because when the program starts to swap data to the drive things slow to a crawl. But worse, if the size is too large and I try to amend an array ( a b}c), J crashes the machine -- no out of memory error, no exiting J, but the Ubuntu equivalent of "the blue screen of death" telling me to reboot the machine. Is this expected behavior?

"Thank you for your attention." :-)
Patrick

Clifford Reiter

unread,
Apr 29, 2026, 3:31:28 PM (8 days ago) Apr 29
to fo...@jsoftware.com
For the first question maybe use adverse:

mkdir=:1!:5@< :: 0:

mkdir 'c:\temp\cliffo\'

1

mkdir 'c:\temp\cliffo\'

0





To unsubscribe from this group and stop receiving emails from it, send an email to forum+un...@jsoftware.com.

J. Patrick Harrington

unread,
Apr 29, 2026, 3:52:56 PM (8 days ago) Apr 29
to fo...@jsoftware.com
Many thanks. I knew it would be simple. But I've never used adverse before.

Henry Rich

unread,
Apr 29, 2026, 4:01:06 PM (8 days ago) Apr 29
to fo...@jsoftware.com
If you can give me an example - don't bother cutting it down to a small example - I will fix it if I can make it fail.  Also tell me how much memory you have in your system.

Henry Rich

Devon McCormick

unread,
Apr 29, 2026, 6:11:42 PM (8 days ago) Apr 29
to fo...@jsoftware.com
For your large arrays, are you able to use memory-mapped files?  They provide both large capacity and good access speed.

Devon McCormick



bill lam

unread,
Apr 29, 2026, 8:44:31 PM (8 days ago) Apr 29
to fo...@jsoftware.com
That would work but it fails to create intermediate folders. The verb mkdir_j_ is available for that purpose.
Reply all
Reply to author
Forward
0 new messages