Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Mike Chinander
Oops, just saw your later email with your code that checks this. On Mon, Aug 31, 2015 at 4:52 PM, Mike Chinander wrote: > > Does loadFromData() still return true when you get a messed up pixmap? > > > On Mon, Aug 31, 2015 at 2:49 PM, Igor Mironchik > wrote: > >> Hi, >> >> On 31.08.2015 22:42, A

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Mike Chinander
Does loadFromData() still return true when you get a messed up pixmap? On Mon, Aug 31, 2015 at 2:49 PM, Igor Mironchik wrote: > Hi, > > On 31.08.2015 22:42, Alexey Godko wrote: > > just check QPixmap::isNull() > > > Pixmap is not null... Image was saved for the half and I read it... Pixmap > su

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
On 31.08.2015 23:36, Thiago Macieira wrote: > On Monday 31 August 2015 22:35:12 Igor Mironchik wrote: >> How can I be sure that image loaded completely? > Monitor the file for changes and open it only when it has settled (one second > after the last write). I know that I can find the answer in s

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Rainer Wiesenfarth
From: Igor Mironchik > [...] > Even if try to open file in ReadWrite mode it opens successfully... > [...] > > And sometimes I receive: loading failed and pixmap is null. Reloading of such > images is successfull... > > I can't reproduce reading of saved on the half image. May be ReadWrite mode >

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Thiago Macieira
On Monday 31 August 2015 13:36:44 Thiago Macieira wrote: > On Monday 31 August 2015 22:35:12 Igor Mironchik wrote: > > How can I be sure that image loaded completely? > > Monitor the file for changes and open it only when it has settled (one > second after the last write). Unless you have access

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Thiago Macieira
On Monday 31 August 2015 22:35:12 Igor Mironchik wrote: > How can I be sure that image loaded completely? Monitor the file for changes and open it only when it has settled (one second after the last write). -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Sou

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
Hi, On 31.08.2015 23:13, John Weeks wrote: >> On Aug 31, 2015, at 12:49 PM, Igor Mironchik >> wrote: >> >> Pixmap is not null... Image was saved for the half and I read it... Pixmap >> successfully loaded but draws only first part of the image while the next >> one is grey... > I forget how L

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread John Weeks
> On Aug 31, 2015, at 12:49 PM, Igor Mironchik wrote: > > Pixmap is not null... Image was saved for the half and I read it... Pixmap > successfully loaded but draws only first part of the image while the next one > is grey... I forget how Linux works- can you try opening for write? On the sys

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
Hi, On 31.08.2015 22:42, Alexey Godko wrote: just check QPixmap::isNull() Pixmap is not null... Image was saved for the half and I read it... Pixmap successfully loaded but draws only first part of the image while the next one is grey... 2015-08-31 22:35 GMT+03:00 Igor Mironchik

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Alexey Godko
just check QPixmap::isNull() 2015-08-31 22:35 GMT+03:00 Igor Mironchik : > Hi, > > On 31.08.2015 21:19, Thiago Macieira wrote: > > On Monday 31 August 2015 20:09:48 Igor Mironchik wrote: > >> But the same problem exists on my Linux machine, where I don't have any > >> antiviruses... > > What's th

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
Hi, On 31.08.2015 21:19, Thiago Macieira wrote: > On Monday 31 August 2015 20:09:48 Igor Mironchik wrote: >> But the same problem exists on my Linux machine, where I don't have any >> antiviruses... > What's the error message on Linux? If possible, run your application with > strace to catch the o

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Thiago Macieira
On Monday 31 August 2015 10:06:26 John Weeks wrote: > Do you have virus protection software on your machine? We have had to > implement a system of re-tries to get around the fact that virus protection > software will often open and check a file right after the file is created. An interesting afte

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Thiago Macieira
On Monday 31 August 2015 20:09:48 Igor Mironchik wrote: > But the same problem exists on my Linux machine, where I don't have any > antiviruses... What's the error message on Linux? If possible, run your application with strace to catch the open call and its return value. -- Thiago Macieira -

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread John Weeks
> On Aug 31, 2015, at 9:54 AM, Igor Mironchik wrote: > > But this file nobody axcept my application is trying to read. Do you have virus protection software on your machine? We have had to implement a system of re-tries to get around the fact that virus protection software will often open and

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
Hi. 8/31/2015 8:04 PM, Mike Chinander пишет: Could your slot be getting the directoryChanged() signal before the file write has completed by the other process (not sure how the file is being created)? Possible, I thought about it. Files copied to the monitored directory by Windows Explorer.

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Alexey Godko
+1 to exclude antivirus software. We have had to do the same as John Weeks suggesting, on .NET/Window.Forms platform. Especially occurs with Avast software In all cases - you must wait, until file freed by another process. 2015-08-31 20:06 GMT+03:00 John Weeks : > > > On Aug 31, 2015, at 9:54 AM,

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
8/31/2015 8:06 PM, John Weeks пишет: >> On Aug 31, 2015, at 9:54 AM, Igor Mironchik wrote: >> >> But this file nobody axcept my application is trying to read. > Do you have virus protection software on your machine? We have had to > implement a system of re-tries to get around the fact that vir

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Mike Chinander
Could your slot be getting the directoryChanged() signal before the file write has completed by the other process (not sure how the file is being created)? On Mon, Aug 31, 2015 at 11:54 AM, Igor Mironchik wrote: > 8/31/2015 7:40 PM, Alexey Godko пишет: > > What exactly error did you expect? > >

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
8/31/2015 7:40 PM, Alexey Godko пишет: What exactly error did you expect? The process cannot access the file because it is used by another process. But this file nobody axcept my application is trying to read. From OS I copied new file to the monitored system... And that's all 2015-08-31

Re: [Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Alexey Godko
What exactly error did you expect? 2015-08-31 19:31 GMT+03:00 Igor Mironchik : > Hi guys, > > I set up QFileSystemWatcher for monitoring some directory. All is fine > But sometimes in slots connected to the directoryChanged() I can't do > file reading... I', trying to open file with QIODevice::Re

[Interest] QFileSystemWatcher and accesing files in monitored directory...

2015-08-31 Thread Igor Mironchik
Hi guys, I set up QFileSystemWatcher for monitoring some directory. All is fine But sometimes in slots connected to the directoryChanged() I can't do file reading... I', trying to open file with QIODevice::ReadOnly, but it fails... Can it be problem of implementation of QFileSystemWatcher? How