重新打开文件 [英] Re-opening a file

查看:71
本文介绍了重新打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。在我的应用程序中,我做了一件非常简单的事情 - 我打开一个文件,锁定

它专门为它写一些数据并关闭它。


如果我重新 - 在相同的过程中打开它(我的意思是在脚本有
结束之前)读取文件,我发现我写的数据并不存在
存在在那里。在我再次运行脚本之前我无法读回来。


我的问题如下:什么

Hi. In my application I do something very simple - I open a file, lock
it exclusively, write some data to it and close it.

If I re-open it in the same process (I mean before the script has
ended) to read the file, I find that the data I have written doesn''t
exist in there. I can''t read it back until I run the script again.

My question follows: WHAT

推荐答案

W Marsh写道:
W Marsh wrote:

嗨。在我的应用程序中,我做了一件非常简单的事情 - 我打开一个文件,锁定

它专门为它写一些数据并关闭它。


如果我重新 - 在相同的过程中打开它(我的意思是在脚本有
结束之前)读取文件,我发现我写的数据并不存在
存在在那里。在我再次运行脚本之前我无法读回来。


我的问题如下:什么
Hi. In my application I do something very simple - I open a file, lock
it exclusively, write some data to it and close it.

If I re-open it in the same process (I mean before the script has
ended) to read the file, I find that the data I have written doesn''t
exist in there. I can''t read it back until I run the script again.

My question follows: WHAT



对不起,我的水晶球在店里。我不知道发生什么可能是b $ b。也许如果你发布你的代码...


-

================== br />
删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

Sorry, my crystal ball is in the shop. I have no idea what might be
happening. Maybe if you post your code...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


7月15日14:41,Jerry Stuckle< jstuck ... @ attglobal.netwrote:
On 15 Jul, 14:41, Jerry Stuckle <jstuck...@attglobal.netwrote:

W Marsh写道:
W Marsh wrote:

嗨。在我的应用程序中,我做了一件非常简单的事情 - 我打开一个文件,锁定

它专门为它写一些数据并关闭它。
Hi. In my application I do something very simple - I open a file, lock
it exclusively, write some data to it and close it.


如果我在同一个过程中重新打开它(我的意思是在脚本结束之前已经结束了b $ b)来阅读文件,我发现我写的数据并不存在
。在我再次运行脚本之前,我无法读回来。
If I re-open it in the same process (I mean before the script has
ended) to read the file, I find that the data I have written doesn''t
exist in there. I can''t read it back until I run the script again.


我的问题如下:什么是
My question follows: WHAT



对不起,我的水晶球在店里。我不知道发生什么可能是b $ b。也许如果你发布你的代码...


-

================== br />
删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司

jstuck ... @ attglobal.net

==================


Sorry, my crystal ball is in the shop. I have no idea what might be
happening. Maybe if you post your code...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================



否。一方面它是私有的商业代码,第二,我已经给出了足够的关于这个问题的信息。


我不会很感激人们做出类似的讽刺评论。如果你不知道问题然后保持安静,或者如果你真的没有重要的细节,请提出礼貌请求,例如: 你是否在关闭和重新打开文件之间做了X
。对于你的不安全和自我问题,我不是一个出口




如果你真的那么缺乏想象力,那么这里有一些代码(使用我的

将原始描述作为设计规范,证明了我的观点:


define(FILE_NAME," somefile.txt");

No. For one thing it''s private, commercial code, and secondly, I''ve
given enough information about the problem.

I don''t appreciate people making sarcastic comments like that. If you
have no idea about the problem then keep quiet, or if you genuinely
are missing important details, make a polite request, e.g. "Are you
doing X between closing and re-opening the file?". I''m not an outlet
for problems with your insecurities and ego.

If you really are that unimaginative, then here''s some code (using my
own original description as a design spec, proving my point somewhat):

define(FILE_NAME, "somefile.txt");


dataOrig = array(" here,is,some,data,to,be) ,

" serialized");

dataOrig = array("here", "is", "some", "data", "to", "be",
"serialized");


这篇关于重新打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆