Giter VIP home page Giter VIP logo

Comments (2)

MockbaTheBorg avatar MockbaTheBorg commented on August 21, 2024 1

Closing .... this proved much more complicated than I thought. May require a full rewrite of RunCPM's filesystem. Giving up for now.

from runcpm.

mecparts avatar mecparts commented on August 21, 2024

At the risk of resurrecting a dead issue, I've just now got $SYS, $R/O, $ARC and $PUBLIC working in my ZCPR3.3 fork of RunCPM.

Background: months ago I modified the file system routines to examine the FAT file's attribute bits and set the corresponding bits in the FCB's filename and type. Hidden became Public (FN2), and ReadOnly, System and Archive slid into FT1, FT2, and FT3. With the SD card plugged into a Linux system, I could use fatattr to set the various bits, and when the card was plugged back into the RunCPM system, the altered BDOS would see (and respect) the attributes. That was enough to get NovaDOS's/Z80DOS's public file support working, as well as preventing writes to $R/O files and hiding $SYS files in directory listings.

But while there was support in SdFat for reading the file attributes, there wasn't any for setting them. Which was a bit of a pain. Any time I wanted to change an attribute I had to shut down the RunCPM system, pull the card, put it in the Linux box, fatattr the file, pull the card again, etc., etc. But tonight I sat down and starting going through the SdFat library with a fine tooth comb. I figured out that I could add a handful of routines alongside isHidden(), isReadOnly() and isSystem() to set the attributes: makeHidden(), makeReadOnly(), makeSystem() and makeArchive(). Each gets passed a boolean parameter indicating whether the attribute should be set or reset. In addition, each make...() routine also sets the file's dirty bit. So when the file is closed, and sync() is called, the directory entry gets updated. A few lines of code in sync() was enough to transfer the attribute bits from the FatFile instance into the directory entry and get them written to the SD card. So now STAT can change the $R/O and $SYS attributes, and PUBLIC can do the same to the $PUBLIC attributes.

Keep in mind, I've done this in my divergent ZCPR3.3 fork. It's fairly different than the master branch by now, and it's only been done for the Arduino side of things. It's possible that the same kind of mods I've made to get the attributes working could be done for the Windows build; after all, I've done this with FAT file attributes and that's an MSDOS thing. But I'm not at all sure how a Linux port would work. Assuming I don't discover that my "let's try this and see how it goes" mods to SdFat have ended up trashing the filesystem on my SD card, is it worthwhile thinking about backporting something that might end up only working on some systems?

from runcpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.