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

Tutorials and help articles.

(Posts require approval. See pinned post.)
Forum rules
Post guides, tutorials, and other instructional content here.

This topic area requires approval, so please be patient while we review content to make sure it fits the expectations for this topic area.

Tech support questions should be asked in Hardware or Software support.
Post Reply
waspentalive
Posts: 24
Joined: Fri Jun 17, 2022 5:51 pm
Location: Sacramento, CA

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

Post 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.

 

waspentalive
Posts: 24
Joined: Fri Jun 17, 2022 5:51 pm
Location: Sacramento, CA

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

Post 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?

TomXP411
Posts: 1781
Joined: Tue May 19, 2020 8:49 pm

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

Post 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: 


 

 

waspentalive
Posts: 24
Joined: Fri Jun 17, 2022 5:51 pm
Location: Sacramento, CA

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

Post 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.

 

User avatar
desertfish
Posts: 1094
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

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

Post 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.

waspentalive
Posts: 24
Joined: Fri Jun 17, 2022 5:51 pm
Location: Sacramento, CA

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

Post 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?

 

User avatar
desertfish
Posts: 1094
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

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

Post 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.

waspentalive
Posts: 24
Joined: Fri Jun 17, 2022 5:51 pm
Location: Sacramento, CA

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

Post 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 )

 

waspentalive
Posts: 24
Joined: Fri Jun 17, 2022 5:51 pm
Location: Sacramento, CA

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

Post by waspentalive »


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



 

waspentalive
Posts: 24
Joined: Fri Jun 17, 2022 5:51 pm
Location: Sacramento, CA

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

Post 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.

Post Reply