NetTalk Central

Author Topic: Cannot open file  (Read 6440 times)

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Cannot open file
« on: January 03, 2012, 03:29:27 PM »
I am sending a set of tps files to a server and this has been working fine up until now.

What is happening is that one of the files is empty. It exists as size 2kb but has no records in it. When trying to transfer this file it seems to place it on the server but when I view the file it is corrupt. I suspect FTP does not like transferring files with 0 records,

How can I get round this problem?

BTW I am processing and creating the files to send. In this case I do not even create this file myself but is created by the dictionary and I cannot put dummy records in.

There is nothing special about this and is based on the example and works 100% until there is a file with 0 records.

Thanks

John

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Cannot open file
« Reply #1 on: January 03, 2012, 04:07:13 PM »
Try to Rename or delete the file from the server before transferring the local file.

Or try the above but don't trf the file, let your program create a blank file.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Cannot open file
« Reply #2 on: January 03, 2012, 10:16:40 PM »
Hi John,

Obviously to FTP the file is just a binary file, it has no clue if there is data in it or not.

My guess is that when you upload it, the file is held open at either the sending side, or receiving side by another program so the upload fails.

cheers
Bruce

John Fligg

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
    • Ambrit Software
    • Email
Re: Cannot open file
« Reply #3 on: January 04, 2012, 09:06:07 AM »
Thanks Bruce. It was Clarion opening the files because they are listed in Other Files.

I needed to explicitly close these not realising FTP would be a problem. The reason some failed was because some were beign processed by my code where I was explicitly closing them anyway.

Thanks

John