Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Existing file is not found!
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows Server 2003
Divers
Thread ID:
01072670
Message ID:
01072685
Vues:
18
Alex,

Could it be that the file is used at the time you;re trying to copy it? Did you try to use UNC path instead or the drive letter?

>Hi,
>
>I'm having a crazy error happening randomly:
> System.IO.FileNotFoundException: Could not find file "f:\Case.dbf".
>
>F: is a drive in a novell 4.11 server.
>E: is a drive in the local machine (where this code is running).
>
>Here's the code:
Try
>     File.Copy("f:\case.dbf", "e:\GeneralDropFolder\case.dbf", True)
> Catch ex As Exception
>     'There was a problem copying the file.
>     CopySuccessful = False
>     'Add entry of this event to log.
>     Echo("Attempt to copy file f:\case.dbf to e:\GeneralDropFolder failed." _
>         + Chr(13) + Chr(10) + "Additional error information: " _
>         + Chr(13) + Chr(10) + ex.tostring(), False, True)
> End Try
Here's the output from the log:
2005-11-28 22:01:56 Attempt to copy file f:\Case.dbf to E:\GeneralDropFolder failed.
>Additional error information:
>System.IO.FileNotFoundException: Could not find file "f:\Case.dbf".
>File name: "f:\Case.dbf"
>   at System.IO.__Error.WinIOError(Int32 errorCode, String str)
>   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
>   at FTPDirect.Module1.Main()
Right after the program aborts, I go to the computer, try to access the F: drive and everything is there (F:, F:\case.dbf, etc.). It shouldn't have failed.
>
>Anybody has any ideas of what could be causing this? Or at least how to track the damn thing down?
>
>I've added code to have the program wait 10 minutes and attempt 2 more times (at 10 min intervals) and all the attempts fail.
>
>After I log onto the machine and try to access the file that wasn't found, I have no problems.
>
>I then re-run the program that does the copying and that works as well.
>
>We're pretty desperate.
>
>Thanks for your help!!!!
>
>Alex
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform