Search results

  1. Bill Evans at Mariposa

    Solved sbcl: retrieving the script name

    Actually, the first value of that array is the name of sbcl itself, which is my problem. I want to get hold of the "1.sb". That's the easy part. :)
  2. Bill Evans at Mariposa

    Solved sbcl: retrieving the script name

    Suppose I have a file named 1.sb with this content:#!/usr/local/bin/sbcl --script (prin1 sb-ext:*posix-argv*) (terpri) If I invoke it as 1.sb a b c I get this output:("/usr/local/bin/sbcl" "a" "b" "c") How do I get the name of the script file itself (1.sb)? (I got no takers on stackoverflow...
  3. Bill Evans at Mariposa

    C confused by unlink(2) man page

    Actually the Butenhof book guides the reader along an amazingly good first step in that direction (among other potential thread gotchas).
  4. Bill Evans at Mariposa

    C confused by unlink(2) man page

    This, of course, is criminal. Agreed. As long as we're talking about paper documentation and POSIX and threads, two books covering POSIX threads are wildly different, and it's the only time I've been disappointed with an O'Reilly book. That book, Pthreads Programming by Nichols, Buttlar &...
  5. Bill Evans at Mariposa

    Solved opposite of chflags(2)

    Cool. But I had actually seen that man page, and what I saw was this: The values for the flag are constructed by a bitwise-inclusive OR of flags from the following list, defined in <fcntl.h>: AT_SYMLINK_NOFOLLOW If path names a symbolic link, the status of the...
  6. Bill Evans at Mariposa

    Solved opposite of chflags(2)

    I know I can use chflags to change the flags on a file. How do I find out what they are in the first place? I must be staring at the answer in the documentation but not seeing it. I know my C program can do an ls -lo on the file and then parse the returned string, but I don't want to fire up a...
  7. Bill Evans at Mariposa

    C confused by unlink(2) man page

    ... and no offense taken. In the migration from Linux, I spend a significant amount of time correcting code written (a) when I was a much less mature coder, and (b) when it seemed a safe assumption that I'd be with Linux.
  8. Bill Evans at Mariposa

    C confused by unlink(2) man page

    My original code running under Linux, upon wanting to remove something which was either a regular file or a directory, simply tried an unlink; upon success, it was done. Upon getting EISDIR, it did an rmdir (and tested the result, of course). Under Linux, that worked smoothly; the directory got...
  9. Bill Evans at Mariposa

    C confused by unlink(2) man page

    For us in userland, the answer lies in making our code POSIX compliant. We all know who (*coughPoetteringcough*) doesn't think much of keeping code POSIX compliant, don't we? That's not the reason I left Linux, but it's closely related.
  10. Bill Evans at Mariposa

    C confused by unlink(2) man page

    Agreed. That's been pretty much my guiding principle. The particular program I'm porting from Linux does indeed handle any error. The way I want it to handle unanticipated errors in this case is to come to a "screeching" (figuratively speaking) "halt" (figuratively speaking, with modern...
  11. Bill Evans at Mariposa

    C confused by unlink(2) man page

    According to the unlink man page, if one tries to unlink() a directory, one gets the EISDIR error. But one also gets the EPERM error. Obviously only one can be true, and the one that seems to be true is EPERM; that's apparently what POSIX specifies. So are both errors listed in the man page to...
  12. Bill Evans at Mariposa

    Perl Perl script to run as root (generalized)

    After some brainstorming: All the requirements can be met through the following steps. First we show steps which are done just once. Step one. Since each script which should be run as root has to be marked by user root somehow (otherwise, just any user could do this), the system administrator...
  13. Bill Evans at Mariposa

    Perl Perl script to run as root (generalized)

    Yes (but it was nonetheless good for you to mention it). The goal is to be able to make a script eligible to be run as root just by changing something about the script itself, without having to update any configuration files and such. This sounds picky, but over the long haul, the more...
  14. Bill Evans at Mariposa

    Perl Perl script to run as root (generalized)

    I would like to be able to run certain Perl scripts on my system as root, even though the "user" calling them is not running as root. For each script I can write a C wrapper, setting setuid root for that wrapper; the wrapper would change the UID to 0 and then call the Perl script, which itself...
  15. Bill Evans at Mariposa

    Why is hub required on host to host connection?

    Sounds like a plan, except that I don't yet have a crossover cable and I already have a hub. It's kinda cool for the grandkids to see the green lights on the hub flicker when there's traffic. :) /down with emojis //ascii art for the win
  16. Bill Evans at Mariposa

    Why is hub required on host to host connection?

    Yes. Really a hub. Went upstairs and pulled it out of a Zip-Loc bag. No configuration necessary, of course. Sometimes simple is good. I had thought that perhaps there would be a software solution to this problem, because under Linux the connection with an ordinary cable works just fine. So hub...
  17. Bill Evans at Mariposa

    Why is hub required on host to host connection?

    In the past I've had two Linux hosts; call them tiger and apteryx. Host tiger has a network interface connected to a DSL modem; no problems there. Host tiger has another network interface, with a cable running directly from that interface to host apteryx's only interface; that connection is host...
  18. Bill Evans at Mariposa

    dhclient trashing alias IP address upon reconnect

    When a host boots, I don't want DHCP to come up right away; I want that to wait until an arbitrary point later. But what I do want at boot time is a hard IP address (for example, 10.0.0.3) to be automatically associated with the interface. I use ifconfig(8) for that in an rc file, and it works...
  19. Bill Evans at Mariposa

    Solved configuration question: persistent gid after su

    I'm an immigrant from Linux, so I was used to Linux's way of doing things. It turns out that the group associated with a new file is not that of the creator, whether or not the -l option was used with su(1). The rules are these. As just stated, a new file inherits the group of its enclosing...
  20. Bill Evans at Mariposa

    Solved configuration question: persistent gid after su

    I'm using the one without the hyphen. The group on the newly-created file always follows the most recent actual login (which I know the hyphen would simulate), but I don't want to login again. I just want to change the uid and gid, and have that gid be reflected in new files I create without...
Back
Top