RSS/Atom feed Twitter
Site is read-only, email is disabled

Selecting new constants for '(file-type file)'?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Selecting new constants for '(file-type file)'? Kevin Cozens 21 Jul 22:10
  Selecting new constants for '(file-type file)'? Markus Triska 22 Jul 23:17
   Selecting new constants for '(file-type file)'? Kevin Cozens 23 Jul 00:06
Selecting new constants for '(file-type file)'? Kevin Myers 22 Jul 19:10
Kevin Cozens
2004-07-21 22:10:31 UTC (over 20 years ago)

Selecting new constants for '(file-type file)'?

Greetings, all.

I want to define some constants related to file type for use in Tiny-Fu. My current thinking is to use FILE_TYPE_FILE (0), FILE_TYPE_DIR (1), and FILE_TYPE_LINK (2). The last one being for *nix systems only. Are there any other file types that should be handled (ie. nodes on *nix systems)?

Comments?

Cheers!

Kevin. (http://www.interlog.com/~kcozens/)

Owner of Elecraft K2 #2172 |"What are we going to do today, Borg?" E-mail:kcozens at interlog dot com|"Same thing we always do, Pinkutus: Packet:ve3syb@ve3yra.#con.on.ca.na| Try to assimilate the world!" #include | -Pinkutus & the Borg

Kevin Myers
2004-07-22 19:10:54 UTC (over 20 years ago)

Selecting new constants for '(file-type file)'?

FYI, Windows 2000 and XP both (partially) support variaties of hard and symbolic links under NTFS in certain scenarios. Then of course there are also the half-ass implemented Windows shortcut files (*.lnk). Finally, software also exists that allows Windows to access a *nix based file system where regular *nix style links might exist. Depending on your exact needs and purposes, I just thought those might be worth mentioning. Don't believe these impact your constants at all, but would hate to see link support omitted for Windows if only due to lack of familiarity with these features.

s/KAM

----- Original Message ---

Markus Triska
2004-07-22 23:17:39 UTC (over 20 years ago)

Selecting new constants for '(file-type file)'?

I want to define some constants related to file type for use in Tiny-Fu. My current thinking is to use FILE_TYPE_FILE (0), FILE_TYPE_DIR (1), and FILE_TYPE_LINK (2). The last one being for *nix systems only. Are there any other file types that should be handled (ie. nodes on *nix systems)?

Maybe I have not given this enough thought, but I would opt for FILE_TYPE_NONEXISTANT (although this can hardly be called a "file" type) so there is some well-defined behaviour if the path to check points nowhere. Also, what happens with access permissions ("not readable")? The call should be well-defined in this case, too, so maybe (to cover both cases), there should be some "FILE_TYPE_ERROR" and other predicates to check for existence/permission.

Markus.

Kevin Cozens
2004-07-23 00:06:55 UTC (over 20 years ago)

Selecting new constants for '(file-type file)'?

On Thu, 2004-07-22 at 17:17, Markus Triska wrote:

Maybe I have not given this enough thought, but I would opt for FILE_TYPE_NONEXISTANT (although this can hardly be called a "file" type) so there is some well-defined behaviour if the path to check points nowhere.

I have decided to use FILE_TYPE_UNKNOWN as the default value if the other checks fail. This handles situations where the file might be (for example) a node, or the user doesn't have the permissions necessary to access the file. I just have to double check I have documented this in the function list for tsx.