Problem
JNode shell mkdir command does not support -p (parents) flag for creating nested directories. Users must create each level manually.
Current Behavior
mkdir /devices/hdc0/a/b/c fails if intermediate directories /devices/hdc0/a or /devices/hdc0/a/b do not exist
- Only single directory creation:
mkdir <directory> with no flags
Expected Behavior
mkdir -p /devices/hdc0/a/b/c should create /devices/hdc0/a, /devices/hdc0/a/b, and /devices/hdc0/a/b/c as needed
mkdir --parents <path> should work as alternative syntax
Validation Instructions (QEMU)
# Start JNode with FAT32 test image
rm -f /tmp/jnode.serial2 /tmp/qemu_serial.log
qemu-system-x86_64 -m 768 -cdrom all/build/cdroms/jnode-x86-lite.iso \
-drive file=/tmp/fat32-working.img,format=raw \
-serial file:/tmp/qemu_serial.log \
-serial unix:/tmp/jnode.serial2,server,nowait \
-no-reboot -display none &
sleep 45
ln -sf /tmp/jnode.serial2 /tmp/jnode_com2
# Test current behavior (should fail if parent does not exist)
python3 .opencode/skills/jnode-interact/scripts/jnode_agent_cmd.py "mkdir /devices/hdc0/parent/child"
# After fix, this should succeed
python3 .opencode/skills/jnode-interact/scripts/jnode_agent_cmd.py "mkdir -p /devices/hdc0/parent/child"
python3 .opencode/skills/jnode-interact/scripts/jnode_agent_cmd.py "ls /devices/hdc0/parent"
Implementation Notes
- Edit
cli/src/commands/org/jnode/command/file/MkdirCommand.java
- Add
--parents | -p option flag
- Use
File.mkdirs() instead of File.mkdir() when -p is specified
- Update XML descriptor:
cli/descriptors/org.jnode.command.file.xml
Unit Tests
- Create test in
cli/src/commands/org/jnode/command/file/MkdirCommandTest.java
- Test: single create, nested create with -p, nested create without -p (should fail)
Problem
JNode shell
mkdircommand does not support-p(parents) flag for creating nested directories. Users must create each level manually.Current Behavior
mkdir /devices/hdc0/a/b/cfails if intermediate directories/devices/hdc0/aor/devices/hdc0/a/bdo not existmkdir <directory>with no flagsExpected Behavior
mkdir -p /devices/hdc0/a/b/cshould create/devices/hdc0/a,/devices/hdc0/a/b, and/devices/hdc0/a/b/cas neededmkdir --parents <path>should work as alternative syntaxValidation Instructions (QEMU)
Implementation Notes
cli/src/commands/org/jnode/command/file/MkdirCommand.java--parents | -poption flagFile.mkdirs()instead ofFile.mkdir()when-pis specifiedcli/descriptors/org.jnode.command.file.xmlUnit Tests
cli/src/commands/org/jnode/command/file/MkdirCommandTest.java