gchar *adbookdir;
GDir *dir;
const gchar *dir_name;
- struct stat statbuf;
+ GStatBuf statbuf;
gchar buf[WORK_BUFLEN + 1];
gchar numbuf[WORK_BUFLEN];
gint len, lenpre, lensuf, lennum;
*/
gboolean addrcache_check_file( AddressCache *cache, gchar *path ) {
gboolean retVal;
- struct stat filestat;
+ GStatBuf filestat;
retVal = TRUE;
if( path ) {
if( 0 == g_stat( path, &filestat ) ) {
*/
gboolean addrcache_mark_file( AddressCache *cache, gchar *path ) {
gboolean retVal = FALSE;
- struct stat filestat;
+ GStatBuf filestat;
if( path ) {
if( 0 == g_stat( path, &filestat ) ) {
cache->modifyTime = filestat.st_mtime;
{
DIR *dp;
struct dirent *d;
- struct stat s;
+ GStatBuf s;
gint num;
int r;
gchar *filename;
GDir *dir;
const gchar *dir_name;
- struct stat s;
+ GStatBuf s;
Template *tmpl;
GSList *tmpl_list = NULL;
off_t get_file_size(const gchar *file)
{
- struct stat s;
+ GStatBuf s;
if (g_stat(file, &s) < 0) {
FILE_OP_ERROR(file, "stat");
time_t get_file_mtime(const gchar *file)
{
- struct stat s;
+ GStatBuf s;
if (g_stat(file, &s) < 0) {
FILE_OP_ERROR(file, "stat");
gboolean file_exist(const gchar *file, gboolean allow_fifo)
{
- struct stat s;
+ GStatBuf s;
if (file == NULL)
return FALSE;
gint remove_dir_recursive(const gchar *dir)
{
- struct stat s;
+ GStatBuf s;
GDir *dp;
const gchar *dir_name;
gchar *prev_dir;
{
FILE *fp;
gchar *str;
- struct stat s;
+ GStatBuf s;
#ifndef G_OS_WIN32
gint fd, err;
struct timeval timeout = {1, 0};
int claws_unlink(const gchar *filename)
{
- struct stat s;
+ GStatBuf s;
static int found_shred = -1;
static const gchar *args[4];
{
gchar **path_parts;
GSList *canonical_parts = NULL;
- struct stat st;
+ GStatBuf st;
int i;
gboolean follow_symlinks = TRUE;
#include "w32lib.h"
-int lstat( const char *file_name, struct stat *buf ){
- return stat( file_name, buf );
+int lstat( const char *file_name, GStatBuf *buf ){
+ return g_stat( file_name, buf );
}
#endif
/*** stat ***/
-int lstat( const char *file_name, struct stat *buf );
+int lstat( const char *file_name, GStatBuf *buf );
/*** sys/wait ***/
pid_t waitpid( pid_t pid, int *status, int options );
gint len;
FILE *fp;
gboolean prev_autowrap;
- struct stat file_stat;
+ GStatBuf file_stat;
int ret;
GString *file_contents = NULL;
ComposeInsertResult result = COMPOSE_INSERT_SUCCESS;
AttachInfo *ainfo;
GtkTreeView *tree_view = GTK_TREE_VIEW(compose->attach_clist);
MimeInfo *mimepart;
- struct stat statbuf;
+ GStatBuf statbuf;
gchar *type, *subtype;
GtkTreeModel *model;
GtkTreeIter iter;
*/
static gboolean jpilot_mark_files( JPilotFile *pilotFile ) {
gboolean retVal = FALSE;
- struct stat filestat;
+ GStatBuf filestat;
gchar *pcFile;
/* Mark PDB file cache */
*/
static gboolean jpilot_check_files( JPilotFile *pilotFile ) {
gboolean retVal = TRUE;
- struct stat filestat;
+ GStatBuf filestat;
gchar *pcFile;
/* Check main file */
gboolean mh_scan_required(Folder *folder, FolderItem *item)
{
gchar *path;
- struct stat s;
+ GStatBuf s;
path = folder_item_get_path(item);
cm_return_val_if_fail(path != NULL, FALSE);
static gboolean mh_is_msg_changed(Folder *folder, FolderItem *item,
MsgInfo *msginfo)
{
- struct stat s;
+ GStatBuf s;
if (g_stat(itos(msginfo->msgnum), &s) < 0 ||
msginfo->size != s.st_size || (
struct dirent *d;
#endif
const gchar *dir_name;
- struct stat s;
+ GStatBuf s;
gchar *real_path, *entry, *utf8entry, *utf8name;
gint n_msg = 0;
static void mh_set_mtime(Folder *folder, FolderItem *item)
{
- struct stat s;
+ GStatBuf s;
gchar *path = folder_item_get_path(item);
cm_return_if_fail(path != NULL);
N_COLUMNS
};
- struct stat st;
+ GStatBuf st;
GtkListStore* list;
GtkTreeIter iter;
GtkTreeView* view;
#ifdef _TEST
void archive_scan_folder(const char* dir) {
- struct stat st;
+ GStatBuf st;
DIR* root;
struct dirent* ent;
gchar cwd[PATH_MAX];
gchar *outfile;
response buf;
int max;
- struct stat info;
+ GStatBuf info;
gchar* msg;
outfile = procmime_get_tmp_file_name(mimeinfo);
g_warning("Can't get the part of multipart message.");
else {
max = config.clamav_max_size * 1048576; /* maximum file size */
- if (stat(outfile, &info) == -1)
+ if (g_stat(outfile, &info) == -1)
g_warning("Can't determine file size");
else {
if (info.st_size <= max) {
}
static void check_permission(gchar* folder) {
- struct stat info;
+ GStatBuf info;
if (g_stat(folder, &info) < 0)
return;
static gchar* get_ip_from_msginfo(MsgInfo *msginfo)
{
gchar *file;
- struct stat ss;
+ GStatBuf ss;
FILE *fp;
gchar buf[BUFFSIZE];
gint hnum;
static gboolean is_recent_enough(const gchar *filename)
{
- struct stat s;
+ GStatBuf s;
time_t t;
if (libravatarprefs.cache_icons) {
time(&start);
while (1) {
int fd;
- struct stat st;
+ GStatBuf st;
time_t now;
/* global timeout */
/* libEtPan! - adds a delay of 5 seconds between each tries */
sleep(5);
- if (stat(lockfilename, &st) < 0) {
+ if (g_stat(lockfilename, &st) < 0) {
if (statfailed++ > 5) {
res = -1;
goto unlock;
int claws_mailmbox_map(struct claws_mailmbox_folder * folder)
{
char * str;
- struct stat buf;
+ GStatBuf buf;
int res;
int r;
- r = stat(folder->mb_filename, &buf);
+ r = g_stat(folder->mb_filename, &buf);
if (r < 0) {
debug_print("stat failed %d\n", r);
res = MAILMBOX_ERROR_FILE;
void claws_mailmbox_timestamp(struct claws_mailmbox_folder * folder)
{
int r;
- struct stat buf;
+ GStatBuf buf;
- r = stat(folder->mb_filename, &buf);
+ r = g_stat(folder->mb_filename, &buf);
if (r < 0)
folder->mb_mtime = (time_t) -1;
else
int (* custom_lock)(struct claws_mailmbox_folder *),
int (* custom_unlock)(struct claws_mailmbox_folder *))
{
- struct stat buf;
+ GStatBuf buf;
int res;
int r;
- r = stat(folder->mb_filename, &buf);
+ r = g_stat(folder->mb_filename, &buf);
if (r < 0) {
buf.st_mtime = (time_t) -1;
}
{
gboolean retVal;
gchar *indexfile;
- struct stat filestat;
+ GStatBuf filestat;
if(tl->g_slist == NULL)
return TRUE;
indexfile = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ADDRESSBOOK_INDEX_FILE, NULL);
- if((stat(indexfile,&filestat) == 0) && filestat.st_mtime <= tl->mtime)
+ if((g_stat(indexfile,&filestat) == 0) && filestat.st_mtime <= tl->mtime)
retVal = FALSE;
else
retVal = TRUE;
static void init_email_slist(void)
{
gchar *indexfile;
- struct stat filestat;
+ GStatBuf filestat;
if(email_slist->g_slist != NULL) {
free_PerlPluginEmailEntry_slist(email_slist->g_slist);
addrindex_load_person_attribute(NULL,add_to_email_slist);
indexfile = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ADDRESSBOOK_INDEX_FILE, NULL);
- if(stat(indexfile,&filestat) == 0)
+ if(g_stat(indexfile,&filestat) == 0)
email_slist->mtime = filestat.st_mtime;
g_free(indexfile);
debug_print("Initialisation of email slist completed\n");
{
PerlPluginTimedSList *tl;
gchar *indexfile;
- struct stat filestat;
+ GStatBuf filestat;
/* Check if key exists. Free it if it does. */
if((tl = g_hash_table_lookup(attribute_hash,attr)) != NULL) {
addrindex_load_person_attribute(attribute_key,add_to_attribute_hash);
indexfile = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ADDRESSBOOK_INDEX_FILE, NULL);
- if(stat(indexfile,&filestat) == 0)
+ if(g_stat(indexfile,&filestat) == 0)
tl->mtime = filestat.st_mtime;
g_free(indexfile);
gchar *path = NULL, *fname = NULL;
DIR *dp;
struct dirent *d;
- struct stat st;
+ GStatBuf st;
gint num;
FeedItem *item = NULL;
RFeedCtx *ctx;
static gboolean rssyl_is_msg_changed(Folder *folder, FolderItem *item,
MsgInfo *msginfo)
{
- struct stat s;
+ GStatBuf s;
gchar *path = NULL;
g_return_val_if_fail(folder != NULL, FALSE);
MimeInfo *sub_info = NULL;
gchar *tmpfilename = NULL;
FILE *fp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpfilename);
- struct stat statbuf;
+ GStatBuf statbuf;
if (!fp) {
g_free(tmpfilename);
MimeInfo *sub_info = NULL;
gchar *tmpfilename = NULL;
FILE *fp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpfilename);
- struct stat statbuf;
+ GStatBuf statbuf;
gchar *content_type = NULL;
if (!fp) {
g_free(tmpfilename);
MimeInfo *sub_info = NULL;
gchar *tmpfilename = NULL;
FILE *fp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpfilename);
- struct stat statbuf;
+ GStatBuf statbuf;
gboolean result = FALSE;
if (!fp) {
g_free(tmpfilename);
MimeInfo *sub_info = NULL;
gchar *tmpfilename = NULL;
FILE *fp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpfilename);
- struct stat statbuf;
+ GStatBuf statbuf;
gboolean result = FALSE;
if (!fp) {
g_free(tmpfilename);
MimeInfo *sub_info = NULL;
gchar *tmpfilename = NULL;
FILE *fp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpfilename);
- struct stat statbuf;
+ GStatBuf statbuf;
gboolean result = FALSE;
if (!fp) {
g_free(tmpfilename);
static gboolean vcal_scan_required(Folder *folder, FolderItem *item)
{
- struct stat s;
+ GStatBuf s;
VCalFolderItem *vitem = (VCalFolderItem *)item;
g_return_val_if_fail(item != NULL, FALSE);
static void vcal_set_mtime(Folder *folder, FolderItem *item)
{
- struct stat s;
+ GStatBuf s;
gchar *path = folder_item_get_path(item);
if (folder->inbox != item)
static void prefs_themes_file_stats(const gchar *filename, gpointer data)
{
- struct stat s;
+ GStatBuf s;
DirInfo *di = (DirInfo *)data;
gint len;
MsgInfo *procheader_parse_file(const gchar *file, MsgFlags flags,
gboolean full, gboolean decrypted)
{
- struct stat s;
+ GStatBuf s;
FILE *fp;
MsgInfo *msginfo;
gint readend;
gchar *tmpfilename;
FILE *outfp, *infp;
- struct stat statbuf;
+ GStatBuf statbuf;
gboolean tmp_file = FALSE;
gboolean flowed = FALSE;
gboolean delsp = FALSE;
FILE *infp = NULL, *outfp;
gint len;
gchar *tmpfilename;
- struct stat statbuf;
+ GStatBuf statbuf;
gboolean err = FALSE;
if (mimeinfo->content == MIMECONTENT_EMPTY)
static MimeInfo *procmime_scan_file_with_offset(const gchar *filename, int offset, gboolean short_scan)
{
MimeInfo *mimeinfo;
- struct stat buf;
+ GStatBuf buf;
if (g_stat(filename, &buf) < 0) {
FILE_OP_ERROR(filename, "stat");