~ubuntu-branches/ubuntu/warty/gnome-vfs2/warty

« back to all changes in this revision

Viewing changes to libgnomevfs/gnome-vfs-module-shared.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2004-10-11 16:04:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011160446-lc0ervct24rylahc
Tags: 2.8.2-0ubuntu1
* New upstream release:
  - performance increase in gnome-vfs-volume-monitor.
  - make folders open with components, to make run-dialog work for folders.
  - add support for additional headers to http backend (Warty: #2163).
  - default to the workgroup specified in smb.conf for network://.
* debian/patches/13_ssl_crash.patch:
  - removed, these changes are in the new version.
* debian/patches/14_default-workgroup.patch:
  - removed, these changes are in the new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include "gnome-vfs-module.h"
13
13
#include "gnome-vfs-ops.h"
14
14
 
 
15
/**
 
16
 * gnome_vfs_mime_type_from_mode:
 
17
 * @mode:
 
18
 *
 
19
 * Returns a MIME type based on the mode passed. It only works when mode
 
20
 * references a special file (directory, device, fifo, socket or symlink)
 
21
 *
 
22
 * Returns: a string containing the MIME type, if @mode is a normal file
 
23
 * returns NULL.
 
24
 **/
 
25
 
15
26
const gchar *
16
27
gnome_vfs_mime_type_from_mode (mode_t mode)
17
28
{
37
48
        return mime_type;
38
49
}
39
50
 
 
51
/**
 
52
 * gnome_vfs_get_special_mime_type:
 
53
 * @uri:
 
54
 *
 
55
 * Gets the MIME type for @uri, this function only returns the type
 
56
 * when the URI points to a file that can't be sniffed (sockets, 
 
57
 * directories, devices, and fifos).
 
58
 *
 
59
 * Returns: a string containing the mime type, NULL if the @uri doesn't 
 
60
 * present an special file.
 
61
 **/
 
62
 
40
63
const char *
41
64
gnome_vfs_get_special_mime_type (GnomeVFSURI *uri)
42
65
{
109
132
        file_info->size = statptr->st_size;
110
133
        file_info->block_count = statptr->st_blocks;
111
134
        file_info->io_block_size = statptr->st_blksize;
 
135
        if (file_info->io_block_size > 0 &&
 
136
            file_info->io_block_size < 4096) {
 
137
                /* Never use smaller block than 4k,
 
138
                   should probably be pagesize.. */
 
139
                file_info->io_block_size = 4096;
 
140
        }
112
141
 
113
142
        file_info->atime = statptr->st_atime;
114
143
        file_info->ctime = statptr->st_ctime;