guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting the name of file-like objects


From: Justin Veilleux
Subject: Getting the name of file-like objects
Date: Fri, 1 Apr 2022 16:29:56 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1

Hi everyone. I'm currently writing a set of helper functions (usually written using `computed-file`  which act on file like objects to transform them in some way.
For instance, I have a `decompress` function which, given a file-like object pointing to an archive, will return a computed file object which it will decompress to it's output.
Everything works very well, but I would like to be able to name the `computed-file` objects something meaningfull.
```
(define (unzip f)
  (computed-file (string-append (name f) "-unzipped")
    #~(begin
        (system* (string-append #$unzip "/bin/unzip")
                 "-d" #$output
                 #$file))
         #$out))
```

Is there someting which ressembles the imaginary `name` function I used above?

Cheers.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]