Re: How to get file type when G_FILE_MONITOR_EVENT_DELETED?
- From: Lex Trotman <elextr gmail com>
- To: Vikram Ambrose <noel ambrose gmail com>
- Cc: gtk-list gnome org
- Subject: Re: How to get file type when G_FILE_MONITOR_EVENT_DELETED?
- Date: Sun, 12 Dec 2010 21:10:46 +1100
On 12 December 2010 19:09, Vikram Ambrose <noel ambrose gmail com> wrote:
> How do you figure out the file type inside GFileMonitor's "changed" callback
> when the GFileMonitorEvent is a G_FILE_MONITOR_EVENT_DELETED?
>
> I was erroneously using g_file_query_file_type()!=G_FILE_TYPE_DIRECTORY,
> without actually looking at the return value, until recently discovered that
> since the GFile in question has just been deleted, it would always return
> G_FILE_TYPE_UNKNOWN.
A deleted file doesn't exist so it doesn't have a type. Since the
event is telling you the file is deleted you already know this and
don't need to query the type (or you can use the fact that
G_FILE_TYPE_UNKNOWN is documented to mean does not exist.
Cheers
Lex
>
>
> Vikram.
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]