Summary

add a `file-type' procedure to posix unit

Metadata

Description

`(file-type FILENAME-OR-FD)' -> SYMBOL

Should return one of

 regular
 directory
 symlink
 fifo
 socket
 char-device
 block-device

Changes and comments

[2010-04-23 14:46:05 UTC] felix removed milestone 4.5.0

[2010-07-04 01:12:22 UTC] felix changed status from new to closed

[2010-07-04 01:12:22 UTC] felix set resolution to fixed

[2010-07-04 01:12:22 UTC] felix wrote:

See experimental branch. The file-type predicates (`regular-file?`, etc.) now also accept a file-descriptor.

[2010-07-10 06:01:03 UTC] zbigniew changed priority from not urgent at all to critical

[2010-07-10 06:01:03 UTC] zbigniew changed status from closed to reopened

[2010-07-10 06:01:03 UTC] zbigniew removed resolution fixed

[2010-07-10 06:01:03 UTC] zbigniew wrote:

Unfortunately this change broke the assumption that regular-file?, etc. will return #f if the file does not exist at all. Now, it throws an error. I think quite a bit of code relies on the old behavior--my own does and so does the core itself. For example, posix#create-directory no longer works at all in recursive mode, because it uses directory? to check for directory existence, and non-existent directories will barf.

[2010-07-10 11:33:35 UTC] felix set owner to felix

[2010-07-10 11:33:35 UTC] felix changed status from reopened to assigned

[2010-07-11 15:12:58 UTC] felix set version to 4.5.x

[2010-07-11 15:12:58 UTC] felix set milestone to 4.6.0

[2010-07-11 15:12:58 UTC] felix wrote:

The situation is now as follows (master, commit 0cc55fe):

`file-type' takes an optional flag indicating whether a non-existing file should dsignal an error or if the function should return #f (defaults to signalling an error).

All the file-type predicates return #f if given a filename and the file does not exist.

All file-type predicates with the exception of `symbolic-link?` follow symlinks.

If this agrees with you, please close the ticket.

[2010-07-19 05:57:52 UTC] zbigniew changed status from assigned to closed

[2010-07-19 05:57:52 UTC] zbigniew set resolution to fixed

[2010-07-19 05:57:52 UTC] zbigniew wrote:

Sorry it took me so long to get around to this. Tests out ok, thanks!

[2011-04-04 08:31:00 UTC] felix removed milestone 4.6.0

[2011-04-04 08:31:00 UTC] felix wrote:

Milestone 4.6.0 deleted