freenode/lisp - IRC Chatlog
Search
9:07:01
thijso
If I do (ensure-directories-exist "~/.storage/3") and don't get an error, I should reasonably expect that directory to exist afterwards, right? Is there anything I'm missing? Or is ECL's implementation of that function broken? I really can't imagine that, but on the surface it does look like it...
9:07:40
thijso
The really strange thing is, that creating "~/.storage" the same way, just before, *does* work
9:09:03
thijso
Hhmmm, and if I do the full path without just .storage before, it only creates .storage, not the full one
10:50:57
Shinmera
thijso: note that in Lisp the namestring "foo/bar" is always a file named "bar" in the directory "foo". If you expect it to be a directory, you need to add the trailing slash.
10:51:29
Shinmera
The confusion comes in because the implementation may treat the file "bar" as a directory on the filesystem too, since directories are also files.
11:13:31
thijso
Shinmera: yeah, I kinda knew this, but working often with files and directories in bash sorta trains you otherwise...
11:34:00
jdz
I think it helps to remember that operations on pathnames don't touch the file system at all (except the functions that are specified to do just that, like PROBE-FILE and TRUENAME).
12:05:18
Shinmera
ACTION is reminded to make the sibling library to pathname-utils, filesystem-utils.
15:45:32
jcowan
Is there a usual method of doing random access on ordinary files in CL implementations?
15:47:52
jasom
defining vops can make for very confusing to read code: https://github.com/sionescu/swap-bytes/blob/master/sbcl.lisp
15:55:48
jcowan
Ah, I missed it because I didn't realize it could change the position as well. Thanks, all.
15:57:54
jcowan
That looks fine, particularly the relaxed constraint on file positions in character streams.