473,832 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

L'entrée dépasse la fin du fichier

Bonjour,

j'ai commencé à faire un petit script qui permet d'éditer un fichier, or
lorsque le fichier en question est vide, j'obtient un message du type
"L'entrée dépasse la fin du fichier".

Comment faire ?
Jul 19 '05 #1
5 5077
Montrez un certain code, spécifiquement où le problème se produit.
Google traduit, si désolé pour toutes erreurs.

"Slasher" <no****@nomail. org> wrote in message
news:bk******** **@news-reader4.wanadoo .fr...
Bonjour,

j'ai commencé à faire un petit script qui permet d'éditer un fichier, or
lorsque le fichier en question est vide, j'obtient un message du type
"L'entrée dépasse la fin du fichier".

Comment faire ?

Jul 19 '05 #2
> Montrez un certain code, spécifiquement où le problème se produit.
Google traduit, si désolé pour toutes erreurs.


Sorry, I don't cared this NG was in English...

This is a part of the script where there is a problem :

-------------------
if FSO.fileexists( chemin_fichier) then
%><center><%
response.Write( "Le fichier '"& nom_fich &"' existe")
set FSO = server.CreateOb ject("scripting .filesystemobje ct")
chemin_fichier = server.MapPath( nom_fich)
set inF = FSO.OpenTextFil e(chemin_fichie r,1,false)
contenu = inF.readall
inF.close
-------------------

When the file that I try to open is empty, I see a message like "The entry
exceeds the end of the file"
Jul 19 '05 #3
http://www.microsoft.com/technet/tre...s_scr_eqco.asp

if FSO.fileexists( chemin_fichier) then %><center><% response.Write( "Le
fichier '"& nom_fich &"' existe") set FSO =
server.CreateOb ject("scripting .filesystemobje ct") chemin_fichier =
server.MapPath( nom_fich) set oFile=FSO.GetFi le(chemin_fichi er) if oFile.Size
0 then set inF = FSO.OpenTextFil e(chemin_fichie r,1,false)

contenu = inF.readall inF.close else %>The File is empty<% end if
"Slasher" <no****@nomail. org> wrote in message
news:bk******** **@news-reader4.wanadoo .fr...
Montrez un certain code, spécifiquement où le problème se produit.
Google traduit, si désolé pour toutes erreurs.


Sorry, I don't cared this NG was in English...

This is a part of the script where there is a problem :

-------------------
if FSO.fileexists( chemin_fichier) then
%><center><%
response.Write( "Le fichier '"& nom_fich &"' existe")
set FSO = server.CreateOb ject("scripting .filesystemobje ct")
chemin_fichier = server.MapPath( nom_fich)
set inF = FSO.OpenTextFil e(chemin_fichie r,1,false)
contenu = inF.readall
inF.close
-------------------

When the file that I try to open is empty, I see a message like "The entry
exceeds the end of the file"

Jul 19 '05 #4
Salut!
je sais pas si je comprends bien t'essaie de lire un fichier c'est
ça?? alors voilà qqch qui pourrait peut être t'aider, afin des sites
sur les quels tu devrais trouver les info dont t'as besoin:

http://www.brettb.com/FileAndFolderCheckers.asp
http://support.microsoft.com/default...;EN-US;q299871
http://www.kamath.com/codelibrary/cl005_filename.asp
Ton erreur je pense c'est que tu "check" pour voir si "chemin_fichier "
exist et tout de suite sans après tu fais :chemin_fichier =
server.MapPath( nom_fich)
Moi je pense que ça devrait être qqch comme:
if chemin fichier exist then
---ecrire ton code ici pour lire ton fichier
else
faire le code pour le path et lecture du fichier....
end if

ciao!
"Slasher" <no****@nomail. org> wrote in message news:<bk******* ***@news-reader4.wanadoo .fr>...
Montrez un certain code, spécifiquement où le problème se produit.
Google traduit, si désolé pour toutes erreurs.


Sorry, I don't cared this NG was in English...

This is a part of the script where there is a problem :

-------------------
if FSO.fileexists( chemin_fichier) then
%><center><%
response.Write( "Le fichier '"& nom_fich &"' existe")
set FSO = server.CreateOb ject("scripting .filesystemobje ct")
chemin_fichier = server.MapPath( nom_fich)
set inF = FSO.OpenTextFil e(chemin_fichie r,1,false)
contenu = inF.readall
inF.close
-------------------

When the file that I try to open is empty, I see a message like "The entry
exceeds the end of the file"

Jul 19 '05 #5
> Ton erreur je pense c'est que tu "check" pour voir si "chemin_fichier "
exist et tout de suite sans après tu fais :chemin_fichier =
server.MapPath( nom_fich)
Moi je pense que ça devrait être qqch comme:
if chemin fichier exist then
---ecrire ton code ici pour lire ton fichier
else
faire le code pour le path et lecture du fichier....
end if

ciao!


thank you ! it's work now !
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6294
by: Agathe | last post by:
Bonjour, Je souhaite insérer dans une table MySQL des données provenant d'un fichier texte grâce à un script PHP. Mon fichier porte l'extension "txt" et les données sont séparées par des ";'. J'ai créé un script qui upload le fichier texte sur le serveur et qui lit le contenu de chaque ligne, sépare chaque champ, puis stocke les données dans un tableau indicé pour ensuite insérer ces données dans une table MySQL. Mon script fonctionne...
4
1528
by: SYR | last post by:
I'm using IIS 5.1 under win XP Pro SP1. I'm trying to delete a file using FileSystemObject Set fso = CreateObject("Scripting.FileSystemObject") fichier=server.MapPath("/photos/" & dir & "/" & nom If fso.FileExists(fichier)) Then response.write("fichier existe") fso.DeleteFile(fichier) end if
0
2290
by: SBA03 | last post by:
J'ai une vue de jointure bassée sur plusieurs tables, je peux mettre à jour cette vue grâce à un trigger instead of. Je voudrai charger un fichier csv dont la structure est basée sur celle de ma vue dans ma base ORacle 8.1.7. Existe-t-il une autre solution que lire le fichier ligne et ligne et lancer les ordres d'insert unitairement.
3
2019
by: Thomas Casanova | last post by:
Hi, I am compiling a MSVC++ project on linux gcc 3.3.4. gcc is whimsical about templates. It does understand the declaration of the template type PointerList. It scream the error : 'PointerList' is used as a type, but is not defined as a type. from this sources code: class TableFormat
1
2471
by: eric lecocq | last post by:
Salut, mon problème est le suivant: j'ai une DB avec des liens vers des fichiers texte. je voudrais savoir comment je fais pour pouvoir dire à Access qu'un champ de type date peut être vide ? ou autrement dit, un fichier texte avec des "champs" date vides peut-il être lié sans erreur dans access.
0
1424
by: isore | last post by:
Convertion php to asp.net : PB lecture fichier .ini URGENT URGENT URGENT URGENT URGENT URGENT J'ai un code en php (http://parisports.free.fr) mais le client veut le même en asp.net J'ai converti le php en asp avec la moulinette windows http://81.56.65.81 J'y connais rien mais la bibliotheque de lecture du fichier d'echange (fichier.ini) ne fonctionne plus
4
4689
by: Wildemar Wildenburger | last post by:
Hi :) I'm thinking of letting my program create hardlinks (or symlinks). I know python allows doing this for ext, reiser and the like, but apparently not for ntfs systems. Is there any package out there that lets me create links in a platform independent way? bye wildemar
2
2212
by: sabrina.tremblay | last post by:
Bonjour à tous, voici mon problème : J'utilise asp.net 2.0, je me suis fixée un <httpRuntime executionTimeout="3000" maxRequestLength="11264"/dans mon web.config pour pouvoir uploader des fichier de maximum 10mg avec l'objet asp:fileupload. J'aimerais pouvoir dire à mes utilisateurs lorsqu'ils sélectionnent des fichiers de plus de 10mg : "Fichier trop volumineux... bla bla bla...". j'ai même suivi le conceil de plusieur et mettre une...
7
6389
PEB
by: PEB | last post by:
Hi, I've managed to copy an image to the clipboard from other application different from Access, but i want to get the image in the clipboard and save it in tif format using Access... Somewhere i've found a function that loads the image in an Ole field. Is it necessary to do this before saving the image in tif? Thanks Vlady
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10780
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5623
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.