Reply by Phil D September 25, 20122012-09-25
There's a http_idle(void) but not sure if a similar function exists for
ftp. I don't use the ftp functions in any of my systems so not really
played with it, so i cant be much help

Sorry

Phil

On 25 September 2012 08:34, flanderso11 > wrote:

> **
> --- In r..., Phil D wrote:
> >
> > After writing to FAT I perform;
> >
> > for (i = 0; i < num_fat_devices * FAT_MAX_PARTITIONS;i +> > FAT_MAX_PARTITIONS) {
> > if (fat_part_mounted[i]) {
> > fat_UnmountDevice(fat_part_mounted[i]->dev);
> > }
> > } rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);
> >
> > to dismount and remount partitions this works for me through power cycles
> > without VBAT connected.
> >
> > I'm using sspec_write function to write to flash i don't know if that
> makes
> > a difference
> >
> > Regards
> >
> > Phil
> >
> >
> > On 29 July 2012 23:40, Theodore Politis wrote:
> >
> > > **
>
> > >
> > >
> > > Thank's Phil for your immediate answer
> > > When I mount and dismount the file system (with automount) or when
> format
> > > the device and after mounting the device the symptoms are the same.
> > > There is a #define to tell to compiler to storte the fat table in
> another
> > > location ?
> > > Akis
> > >
> > >
> > >
> > >
> > Hi Phil
>
> Dismounting and remounting the filesystem after every sspec_write() is a
> good solution but if I am running a FTP server simultaneously the
> dismounting will interrupt any ongoing file transfer. Before dismounting I
> would like to check if there is any file being transfered and wait with the
> mounting process until the transfer is complete.
>
> Is there any way to check if there has been any activity on the FTP server
> during the ftp_tick() so I can safely dismount the filesystem without
> losing data?
>
> BR,
> Flanders
>
>
>
Reply by flanderso11 September 25, 20122012-09-25
--- In r..., Phil D wrote:
>
> After writing to FAT I perform;
>
> for (i = 0; i < num_fat_devices * FAT_MAX_PARTITIONS;i +> FAT_MAX_PARTITIONS) {
> if (fat_part_mounted[i]) {
> fat_UnmountDevice(fat_part_mounted[i]->dev);
> }
> } rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);
>
> to dismount and remount partitions this works for me through power cycles
> without VBAT connected.
>
> I'm using sspec_write function to write to flash i don't know if that makes
> a difference
>
> Regards
>
> Phil
> On 29 July 2012 23:40, Theodore Politis wrote:
>
> > **
> >
> >
> > Thank's Phil for your immediate answer
> > When I mount and dismount the file system (with automount) or when format
> > the device and after mounting the device the symptoms are the same.
> > There is a #define to tell to compiler to storte the fat table in another
> > location ?
> > Akis
> >
> >
> >
>

Hi Phil

Dismounting and remounting the filesystem after every sspec_write() is a good solution but if I am running a FTP server simultaneously the dismounting will interrupt any ongoing file transfer. Before dismounting I would like to check if there is any file being transfered and wait with the mounting process until the transfer is complete.

Is there any way to check if there has been any activity on the FTP server during the ftp_tick() so I can safely dismount the filesystem without losing data?

BR,
Flanders

Reply by Theodore Politis July 30, 20122012-07-30
Thank's Phil

I say that before because if you press ctrl+H in the ccpec_xxxxx routines, the help answer has the 'zserver lib' label.

Best regards

Akis
Reply by Phil D July 30, 20122012-07-30
Im using dc 10.64 i dont believe i have zserver defined anywhere in my code
i will check tomorow
On Jul 30, 2012 3:08 PM, "Theodore Politis" wrote:
>
> Hi Phil again
>
> When i make only the definition that you propose i have the folowing
errors
> //line 2371 : ERROR : SSPEC_MOUNT_ANY is out of scope/ not declared.
> //line 2371 : WARNING : Reference to 'sspec_automount' has no
corresponding prototype.
>
> These definitions i think exist in zserver lib.
> Did you have any other definitions in the environment ?
> I use DC10.70
>
> Thank's
> Akis
Reply by Theodore Politis July 30, 20122012-07-30
Hi Phil again

When i make only the definition that you propose i have the folowing errors
//line 2371 : ERROR : SSPEC_MOUNT_ANY is out of scope/ not declared.
//line 2371 : WARNING : Reference to 'sspec_automount' has no corresponding prototype.

These definitions i think exist in zserver lib.
Did you have any other definitions in the environment ?
I use DC10.70

Thank's
Akis
Reply by Theodore Politis July 30, 20122012-07-30
Thank's Phil

I wil try to make it like this

Akis
Reply by Phil D July 30, 20122012-07-30
I dont use zserver lib i have:

#use "fat16.lib"
#define FAT_BLOCK //
#define FAT_USE_FORWARDSLASH //
#define SSPEC_ALLOW_ANONYMOUS_WRITE
#define SSPEC_ALLOW_ANONYMOUS_WRITE
initial mount
rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);

open of file
file=sspec_open("/A/labels.xml", testcontext,O_WRITE|O_CREAT, 0);
close of file
sspec_close(file);

there may be away of using the functions your already using. I
just implemented it this way after i had problems with it not working with
no VBAT

Phil

On 30 July 2012 13:12, Theodore Politis wrote:

> **
> Hi Phil
> You use the zserver lib for these functions?
> Because to work with sspec_write the file argument is a (int)file hanler
> so i must change all the functions of open,close etc..
> (The file name must be "A/xxxxx.xxx" in order to put in in A partition ?)
>
> Thank's
> Akis
>
>
Reply by Theodore Politis July 30, 20122012-07-30
Hi Phil
You use the zserver lib for these functions?
Because to work with sspec_write the file argument is a (int)file hanler so i must change all the functions of open,close etc..
(The file name must be "A/xxxxx.xxx" in order to put in in A partition ?)

Thank's
Akis
Reply by Theodore Politis July 30, 20122012-07-30
Thank's a lot Phil

I will try it

Akis
Reply by Phil D July 29, 20122012-07-29
After writing to FAT I perform;

for (i = 0; i < num_fat_devices * FAT_MAX_PARTITIONS;i +FAT_MAX_PARTITIONS) {
if (fat_part_mounted[i]) {
fat_UnmountDevice(fat_part_mounted[i]->dev);
}
} rc = sspec_automount(SSPEC_MOUNT_ANY, NULL, NULL, NULL);

to dismount and remount partitions this works for me through power cycles
without VBAT connected.

I'm using sspec_write function to write to flash i don't know if that makes
a difference

Regards

Phil
On 29 July 2012 23:40, Theodore Politis wrote:

> **
> Thanks Phil for your immediate answer
> When I mount and dismount the file system (with automount) or when format
> the device and after mounting the device the symptoms are the same.
> There is a #define to tell to compiler to storte the fat table in another
> location ?
> Akis
>
>