可能的错误:目录名禁止执行? [英] Possible Bug: name of directory inhibits execution?

查看:43
本文介绍了可能的错误:目录名禁止执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用MS VS VC ++ 2005 Express编写了一个程序,/ cli pure。在

编译它后,它在GUI开发环境中工作正常。作为Debug独立程序,它也可以作为
罚款。当我重新命名它所在的项目目录名时,我发现了一个奇怪的行为。


我将问题追溯到

申请表是目录的名称!让我解释。我编译了代码,它适用于所有

版本,包括Release独立版本。然后我将整个项目

目录移动到一个新位置并保持相同的名称。它仍然有效。然后我通过点击''XXX''改变了项目目录的名称。它仍然是
有效。但是当我通过在当前日期更改名称时,它停止了

工作!


更详细:


目录名称:... \ Project Demo \Release Works!

目录名称:... \ Project DemoXXX \ Release Works!

目录名称:... \ Project演示 - 10-25-2007 \发布DIES !!


它使用两个不同的目录名称证明了我的代码访问

所有文件*相对*到当前目录(即代码是目录

独立)。因此,目录名称应该是无关紧要的。但是,正如所指出的那样,如果我在项目目录名称之后的DATE处理它,它就会死掉。


我想它有事情要做我在

项目目录名中使用的符号或空格,或其长度。 Haven没试过用一种方式告诉你/ b $ b或b。我怀疑这与它恰好是日期

(10-25-2007)本身有关,但就像我说的那样,我在
中有空格和' - ''符号
它。当然,只要操作系统允许目录名

首先生效,它就应该*工作。我不敢相信操作系统会故意让b $ b允许存在一个目录名,而目录名单独存在

会阻止正确执行它包含的应用程序。 br />

这是操作系统(操作系统)中的一个错误!!!


[== P ==]

I have written a program using MS VS VC++ 2005 Express, /cli pure. Upon
compiling it it works fine in the GUI development environment. It also works
fine as a Debug stand-alone. ut I had an odd behavior when it comes to the
Release varsion when I renamed its project directory name it was in!

I tracked the problem down to it being the NAME of the DIRECTORY the
application is in! Let me explain. I compiled the code, and it worked in ALL
versions, including Release stand-alone. Then I moved the entire project
directory to a new location and kept the same name. It still works. Then I
changed the name of the project directory by tacking on ''XXX''. It STILL
works. But when I change the name by tacking on the currect date, it STOPPED
working!

In more detail:

Directory name: ...\Project Demo\Release Works!
Directory name: ...\Project DemoXXX\Release Works!
Directory name: ...\Project Demo - 10-25-2007\Release DIES!!

The fact it works with two different directory names proves my code access
all files *relative* to current directory (i.e., the code is directory
independent). Thus, directory name should be irrelevant. But, as indicated,
if I tack on the DATE after the project directory name, it dies.

I''m thinking it has something to do with the symbols or spaces I use in the
project directory name, or its length. Haven''t experimented to tell one way
or another. I doubt it has to do with it being precisely the date
(10-25-2007) itself, but like I said, that I have spaces and ''-'' symbols in
it. Of course it *should* work as long as the OS allows the directory name
to be valid in the first place. I can''t believe the OS intentionally would
allow a directory name to exist for which the name of the directory alone
prevents proper execution of the applications it contains.

This HAS to be a bug in the OS (operating system)!!!

[==P==]

推荐答案

>更详细:
>In more detail:

>
目录名称:.. .\Project Demo \Release Works!
目录名称:... \ Project DemoXXX \Release Works!
目录名称:... \ Project Demo - 10-25-2007 \\ D D !! !!我想它与我在
项目目录名中使用的符号或空格或其长度有关。哈文没有尝试过一种方式告诉他人。
>
Directory name: ...\Project Demo\Release Works!
Directory name: ...\Project DemoXXX\Release Works!
Directory name: ...\Project Demo - 10-25-2007\Release DIES!!

I''m thinking it has something to do with the symbols or spaces I use in the
project directory name, or its length. Haven''t experimented to tell one way
or another.



我建议你做那些测试。

I suggest you do those tests.


>这个是操作系统中的错误(操作系统)!!!
>This HAS to be a bug in the OS (operating system)!!!



我对此表示怀疑 - 做更多测试 - 在文件夹名称中调试它,使问题产生



Dave

I doubt it - do more tests - debug it in a folder name that gives rise
to the problem.

Dave


我建​​议你做那些测试


好​​的,我做了测试。这就是我发现的:


如果目录名称长度不超过25个字符,则可以使用。它是26个字符或更多字符,它不是。到目前为止,调用

目录无关紧要,只知道它的名称需要多长时间才能确定该程序的

发布版本(2个目录级别)它内部较低)将会死亡




请注意,无论项目目录是什么,DEBUG版本都可以使用

只有当项目目录名称长度为25或更多b b字符或更少时,才会调用和释放。实际上,它可能更多地绑定到应用程序的FULL PATH名称的

LENGTH,内部使用

支持我的代码的东西(即操作系统)或.NET Framework)。


这听起来像是对你有意吗?对不起,但我很确定

这是VS或OS BUG(或隐藏的限制,我不知道)...... :)


[==彼得==]


PS - 我可以向你保证这与我的代码无关。我的

代码访问文件的唯一时间是在一开始,它只是将图像加载到位图中(位图^ bm = gcnew位图(" filename") );;并且确实ZERO

目录操作。假设我的所有文件都在同一个目录中,而不是
作为应用程序的''exe''文件。没有什么是完整的路径,否则我无法改变目录路径以使其工作。而且因为它总是在SAME项目目录名下的Debug版本中工作,即使

它在Release下失败了,嗯,....

PS - 我的程序没有任何花哨的东西,并通过相对于

应用程序访问所有文件

" David Lowndes" < Da **** @ example.invalidwrote in message

news:1h ************************** ****** @ 4ax.com ...
I suggest you do those tests

OK, I did the tests. And this is what I found:

If the Directory name is 25 characters or less long it works. It it is 26
characters or more, it doesn''t. And so far it doesn''t matter what the
Directory is called, only how long its name is determines whether the
Release version of the program (2 directory-levels lower inside it) will die
or not.

Note that the DEBUG version works no matter what the Project Directory is
called, and Release only works if the Project Directory name is 25
characters or less in length. Actually, it is probably more tied into the
LENGTH of the FULL PATH name to the application, which is used INTERNALLY by
the stuff supporting my code (i.e., the OS or .NET Framework).

Does that sound like INTENDED BEHAVIOR to you? Sorry, but I''m pretty sure
this is a VS or OS BUG (or a hidden restriction I''m not aware of)... :)

[==Peter==]

PS - I can assure you this has nothing to do with my code. The only time my
code accesses files is in the very beginning, where it simply loads in image
files into bitmaps (Bitmap^ bm = gcnew Bitmap( "filename");) and does ZERO
directory manipulation. All my files are assumed to be in the same directory
as the application''s ''exe'' file. And nothing is full path, or else I
couldn''t change the directory path at all for it to work. And since it
always works in Debug version under the SAME Project Directory name even if
it fails under Release, well,....

PS - My program does nothing fancy, and accesses all files via relative to
the application
"David Lowndes" <Da****@example.invalidwrote in message
news:1h********************************@4ax.com...

更详细:

目录名称:... \ Project Demo \Release Works!
目录名称:... \ Project DemoXXX \Release Works!
目录名称:... \ Project Demo - 10- 25-2007 \Dlease DIES !!

我在想它与我在
项目目录名中使用的符号或空格有关,或者它长度。天真没有尝试告诉一个
或其他人。
In more detail:

Directory name: ...\Project Demo\Release Works!
Directory name: ...\Project DemoXXX\Release Works!
Directory name: ...\Project Demo - 10-25-2007\Release DIES!!

I''m thinking it has something to do with the symbols or spaces I use in
the
project directory name, or its length. Haven''t experimented to tell one
way
or another.



我建议你做那些测试。


I suggest you do those tests.


>>这个是一个bug操作系统(操作系统)!!!
>>This HAS to be a bug in the OS (operating system)!!!



我对此表示怀疑 - 做更多测试 - 在一个文件夹名称中调试它,使问题产生了



Dave


I doubt it - do more tests - debug it in a folder name that gives rise
to the problem.

Dave



>这听起来像是对你有意吗?


这听起来像是你的代码中的一个错误(或者你使用的一些库代码)。
>Does that sound like INTENDED BEHAVIOR to you?

It sounds like a bug in your code (or some library code that you use).

>抱歉,我很确定<这是一个VS或OS BUG(或隐藏的限制,我不知道)... :)
>Sorry, but I''m pretty sure
this is a VS or OS BUG (or a hidden restriction I''m not aware of)... :)



我不会所以如果我从你那里得到的证据那么肯定

远!

I wouldn''t be so sure if I were you from the evidence you''ve got so
far!


> PS - 我可以向你保证与我的代码无关。
>PS - I can assure you this has nothing to do with my code.



在调试器下运行它,找出出现问题的地方。

Run it under the debugger and find out where the problem is arising.


>以及它总是在SAME项目目录名下的Debug版本中工作,即使它在Release下失败了,好吧,....
>And since it
always works in Debug version under the SAME Project Directory name even if
it fails under Release, well,....



调试版本的运行环境可能与发布版本略有不同。


您真的需要在

它有问题找出问题的原因。

Dave

The running environment for a debug build can be subtly different from
the release build.

You really need to debug the release version in the situation where
it''s having a problem to find out the cause of the problem.

Dave


这篇关于可能的错误:目录名禁止执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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