Let me give an example:
the script should detect, that file creation is finished :
#!/bin/bash
CID=$1
TYPE=$2
echo "$TYPE$CID" >scan.log
sleep 1
FILE=$TYPE$CID.jpeg
until [ $(ls -l $FILE | awk '{print $5}') -gt 2000 ]
do
echo "sleeping" >> scan.log
sleep 0.4
done
SIZE=`du -h $FILE`
echo "$DT $SIZE " >> scan.log
cp $FILE $TYPE.jpegs
When I call execute it from the shell it is very fast : not one line “sleeping” in the output /scan.log/, so the file is ready in 1 second /first sleep is enough/
Meanwhile, when I call the same script from QT, I have to wait more than 5 seconds /more than 14 lines of sleeping/
Is it possible to fix it? as time is critical in my project…
Thank you in advice
Thank you everybody, I find out the solution,
the problem was QT cashe…
so I just used QFileInfo::refresh(),
QProcess is useless