Page 1 of 1

scratch a file in emulator - I am probably doing it wrong...

Posted: Fri Jun 17, 2022 8:14 pm
by waspentalive

file name was created in lower case.  I have tried the scratch command in both uppercase/graphics and upper/lower case..

DOS "S:|ELLO"

DOS "$" ---> "|ELLO" is still in the directory.

give "VALIDATE" Command - and another directory - it's still there.

I know I could just go to the host's filesystem and probably delete it. But won't that mess up the directory structure?

This file is only one block, but I may need to delete a bigger file someday.

 


scratch a file in emulator - I am probably doing it wrong...

Posted: Fri Jun 17, 2022 9:11 pm
by waspentalive

I went into the host file system and was not able to remove that file until I renamed it.

I created a new save file - named DESTROY.

DOS "SCRATCH:DESTROY"

DOS "VALIDATE"

It is still there. I guess the scratch function in the emulator does not work. What am I doing wrong?


scratch a file in emulator - I am probably doing it wrong...

Posted: Fri Jun 17, 2022 9:42 pm
by TomXP411

Scratch (aka Delete) works fine. I delete files on a regular basis; in fact the file seek demo I wrote while helping Zero with a C problem scratches the temp file that I created to test file I/O.

The catch is you can't use shifted characters in the Scratch command (or any X16-DOS command, as far as I know), and you should just use the first letter (S), not the word SCRATCH. And since FAT32 is not case sensitive, you don't need to shift a character, even if there's a shifted character in the filename. 



So the correct command would have been 

DOS "S:HELLO"



even if the filename is "Hello" or "|ELLO"

Also, afaik, any DOS commands other than the basic SAVE and LOAD commands don't work on the host file system. You need to mount your files in an SD card image. The process is a little different on Windows, Mac, and Linux. 

Here is the Windows method: 


 

 


scratch a file in emulator - I am probably doing it wrong...

Posted: Fri Jun 17, 2022 11:14 pm
by waspentalive

Perhaps part of my issue is that my host system is Linux - and the drive is being hosted on a Linux file system - so it has case sensitivity.

I will need to figure out how to create an SD image on Linux as I do not have a Windows box to work with.

Thanks for the hints.   I have also removed the change to lower case from my AUTOBOOT.X16 so my emulator stays uppercase/graphics.

 


scratch a file in emulator - I am probably doing it wrong...

Posted: Sat Jun 18, 2022 9:48 am
by desertfish

@waspentalive I'm using the mtools package on Linux to manipulate the SD card images. It allows you to show the directory and read/write files to the image, without having to mount it in any form.


scratch a file in emulator - I am probably doing it wrong...

Posted: Sat Jun 18, 2022 10:04 am
by waspentalive

Ok I have installed mtools.   I try

mdir -i ./sdcard.img *

$ mdir -i ./sdcard.img  ::*

init :: non DOS media

Cannot initialize '::'


 

I get this error - any ideas. It would be nice to be able to pull files out so I can share them. Mostly programs like COLATZ which is my main interest (that and c64s)

P.S.  Is there any way I can have the SD card as my drive 8 and the host directory as my drive 9?  I should be able to load then save file s to exfiltrate them from the sdcard. I think I will only need to go one way.   Also in a C64 device 4 is the printer. What about with the X16?

 


scratch a file in emulator - I am probably doing it wrong...

Posted: Sat Jun 18, 2022 10:15 am
by desertfish

I needed this configuration file to get mtools to understand the sdcard image format:

$ cat ~/.mtoolsrc

mtools_skip_check=1

drive x: file="~/cx16sdcard.img" exclusive partition=1




you can now refer to the image file with just x: as well.

Oh, I started with just extracting the sdcard image that is distributed in the official emulator zip file.  It is possible to create one from scratch but I forgot the exact details on how to do that.


scratch a file in emulator - I am probably doing it wrong...

Posted: Sat Jun 18, 2022 11:01 am
by waspentalive

Mine is from the distribution so I am same as you.

Oh well - now it's complaining about a floppy server.

Well bedtime now... zzzz (it's only 04:00 )

 


scratch a file in emulator - I am probably doing it wrong...

Posted: Sat Jun 18, 2022 4:55 pm
by waspentalive

"Big disks not supported on this architecture"  :^(



 


scratch a file in emulator - I am probably doing it wrong...

Posted: Sun Jun 19, 2022 6:52 am
by waspentalive

Ok  - I found out how to mount the sdcard.img file - use losetup to set it up. Then it appears in Dolphin and I can mount it then.

but to make things simple I went back to just using the host file system. So I have to step out of the emulator to remove files from drive 8.  Not too bad as I will probably have that open in in the file manager anyway.

Call this one done then.