forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Compile at root

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Mar 25, 2004 8:06 pm    Post subject: Compile at root Reply with quote

Hi All,
For some strange reason VDS 5.01 will not compile a script at the root directory of my harddrives. I am using Windows 2000 Pro. I am trying to compile just a simple script in the root of both my C drive and D drive. Neither drives have any security settings that would prevent this from happening.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Mar 25, 2004 8:16 pm    Post subject: Reply with quote

The same happens here on Windows XP Professional. I also noted that
it tries to include ~vdstemp.dsu when I was trying to compile a simple
program that was the following:

Code:
info test


There's no need for a DSU to be included. See the following screenshot:



I think this is indeed a bug.

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Fri Mar 26, 2004 12:07 am    Post subject: Reply with quote

I think you should be happy that it does not allow to compile to the root directory, as
otherwise it just might clear your whole root! Shocked
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Mar 26, 2004 12:41 am    Post subject: Reply with quote

lol
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri Mar 26, 2004 10:19 am    Post subject: Reply with quote

It's because the IDE checks that the target directory exists before compiling. The root directory is not a real directory, i.e. there is no file with a directory attribute named C:, so it fails this test.

If it doesn't exist, it creates the exe in the project folder instead. If the project directory is also the root directory, then the IDE can't construct a "safe" target path, so you see the error you got.

All things considered, I think it is a good idea it works this way. Wink It is much better to create your binaries in a separate folder from your source files.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Mar 26, 2004 1:15 pm    Post subject: Reply with quote

Just one question - why does it try to include ~vdstemp.dsu then? Confused
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Mar 26, 2004 1:26 pm    Post subject: Reply with quote

I think the script is precompiled to as a dsu and then it is linked into the exe Rolling Eyes
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri Mar 26, 2004 2:25 pm    Post subject: Reply with quote

CodeScript wrote:
I think the script is precompiled to as a dsu and then it is linked into the exe Rolling Eyes


Correct. Smile

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sat Mar 27, 2004 5:53 pm    Post subject: Reply with quote

jules wrote:
It's because the IDE checks that the target directory exists before compiling. The root directory is not a real directory, i.e. there is no file with a directory attribute named C:, so it fails this test.

If it doesn't exist, it creates the exe in the project folder instead. If the project directory is also the root directory, then the IDE can't construct a "safe" target path, so you see the error you got.

All things considered, I think it is a good idea it works this way. Wink It is much better to create your binaries in a separate folder from your source files.


Jules,
Does the @File VDS function work this same way? Is it using the same component? Also I have never heard of C:\ not being called a directory? C: is the drive while the backslash is the notation for the directory in this case the root directory. No one said we were trying to compile a file like so..
Compiling C:test.dsc

We are trying to compile a file like this

Compiling C:\test.dsc

VDS is not seeing the first backslash as a directory. It is interperting C:\ as C: This tells me that there is a bug in the component that you are using to read the file sturctures.

See this quote from MS Win32 Help file...
Win32.hlp wrote:
The FAT file system organizes data on fixed disks and floppy disks. The distinguishing feature of the FAT file system is its filename convention. The filename convention consists of a filename (up to eight characters), a separating period (.), and a filename extension (up to three characters).

The main advantage of FAT volumes is that they are accessible by MS-DOS, Microsoft® Windows®, and OS/2 systems. FAT is also the only file system currently supported on floppy disks and other removable media.
Valid FAT filenames have the following form:
[[drive:]][[directory\]]filename[[.extension]]
The drive parameter must name an existing drive and can be any letter from A through Z. The drive letter must be followed by a colon (Smile.

The directory parameter specifies the directory that contains the file's directory entry. This value must be followed by a backslash (\) to separate it from the filename. If the specified directory is not in the current directory, directory must include the names of all directories in the file's path, separated by backslashes. The root directory is specified by using a backslash at the beginning of the name. For example, if the directory ABCD is in the directory SAMPLE and SAMPLE is in the root directory, the correct directory specification is \SAMPLE\ABCD. A directory name consists of any combination of up to eight letters, digits, or the following special characters:

$ % ' - _ @ { } ~ ` ! # ( )
A directory name can also have an extension that is any combination of up to three letters, digits, or special characters, preceded by a period (.).
The filename and extension parameters specify the file. Filename can be any combination of up to eight letters, digits, or the special characters previously listed; extension can be any combination of up to three letters, digits, or special characters, all preceded by a period. Filename can also include embedded (preceded and followed by one or more letters, digits, or special characters just noted) spaces. For example, the string "disk 1" is a legal value for filename.

FAT volumes do not distinguish between uppercase and lowercase letters.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Sat Mar 27, 2004 10:20 pm    Post subject: Reply with quote

The IDE and the runtime are completely different code. However, the root directory and subdirectories are different things. The root directory is located only by its position on the HD. Subdirectories are files that have the directory attribute. Therefore I think that @file(C:) or @file(C:\) would return false, though I haven't tested it, because there is no file named either of these things.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Tue Mar 30, 2004 10:25 pm    Post subject: Reply with quote

Ok I guess we have a difference of oppinion here.

For those of you that think that "C:\" is a directory and would like to be able to get the other attributes for this directory I submit this VDS 5 code for your use.



Code:

Title Test Directory
#DEFINE FUNCTION,SSBitAnd
#DEFINE FUNCTION,SSBitOR
#DEFINE FUNCTION,SSBitXOR
#DEFINE FUNCTION,SSHex2Dec
#DEFINE FUNCTION,SSDec2Bin
#DEFINE FUNCTION,SSBin2Dec

%%FILE_ATTRIBUTE_ARCHIVE = 32
%%FILE_ATTRIBUTE_COMPRESSED = 2048
%%FILE_ATTRIBUTE_NORMAL = 128
%%FILE_ATTRIBUTE_DIRECTORY = 16
%%FILE_ATTRIBUTE_HIDDEN = 2
%%FILE_ATTRIBUTE_READONLY = 1
%%FILE_ATTRIBUTE_SYSTEM = 4
%%FILE_ATTRIBUTE_TEMPORARY = 256
%%FILE_ATTRIBUTE_SPARSE_FILE = @Sum($200,0)
%%FILE_ATTRIBUTE_REPARSE_POINT = @Sum($400,0)
%%FILE_ATTRIBUTE_OFFLINE = @Sum($1000,0)
%%FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = @Sum($00002000,0)
%%FILE_ATTRIBUTE_ENCRYPTED = @Sum($4000,0)
%%INVALID_FILE_ATTRIBUTES = $FFFFFFFF
LoadLib kernel32.dll
%S = C:\
%A = @lib(kernel32,GetFileAttributesA,INT:,@ADDR("%S"))
%%FileAttr = $@hex(%A,Cool
If @equal(%%FileAttr,%%INVALID_FILE_ATTRIBUTES)
  Warn Check the path please!
ElsIf @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_DIRECTORY,%A),%%FILE_ATTRIBUTE_DIRECTORY)
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_HIDDEN,%A),%%FILE_ATTRIBUTE_HIDDEN)
    %%Attr = %%Attr"H"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_READONLY,%A),%%FILE_ATTRIBUTE_READONLY)
    %%Attr = %%Attr"R"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_SYSTEM,%A),%%FILE_ATTRIBUTE_SYSTEM)
    %%Attr = %%Attr"S"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_ARCHIVE,%A),%%FILE_ATTRIBUTE_ARCHIVE)
    %%Attr = %%Attr"A"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_NORMAL,%A),%%FILE_ATTRIBUTE_NORMAL)
    %%Attr = %%Attr"N"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_COMPRESSED,%A),%%FILE_ATTRIBUTE_COMPRESSED)
    %%Attr = %%Attr"C"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_TEMPORARY,%A),%%FILE_ATTRIBUTE_TEMPORARY)
    %%Attr = %%Attr"T"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_ENCRYPTED,%A),%%FILE_ATTRIBUTE_ENCRYPTED)
    %%Attr = %%Attr"E"
  End
  if %%Attr
    Info %S is a directory with the file attributes of %%Attr
  else
    Info %S is a directory with no other file attributes set
  end
Else
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_HIDDEN,%A),%%FILE_ATTRIBUTE_HIDDEN)
    %%Attr = %%Attr"H"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_READONLY,%A),%%FILE_ATTRIBUTE_READONLY)
    %%Attr = %%Attr"R"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_SYSTEM,%A),%%FILE_ATTRIBUTE_SYSTEM)
    %%Attr = %%Attr"S"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_ARCHIVE,%A),%%FILE_ATTRIBUTE_ARCHIVE)
    %%Attr = %%Attr"A"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_NORMAL,%A),%%FILE_ATTRIBUTE_NORMAL)
    %%Attr = %%Attr"N"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_COMPRESSED,%A),%%FILE_ATTRIBUTE_COMPRESSED)
    %%Attr = %%Attr"C"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_TEMPORARY,%A),%%FILE_ATTRIBUTE_TEMPORARY)
    %%Attr = %%Attr"T"
  End
  If @Equal(@SSBitAnd(%%FILE_ATTRIBUTE_ENCRYPTED,%A),%%FILE_ATTRIBUTE_ENCRYPTED)
    %%Attr = %%Attr"E"
  End
  if %%Attr
    Info File attributes for %S is %%Attr
  else
    Info %S has no file attributes
  end
End
FreeLib kernel32
Stop

:SSBitAnd
  %%SSBAresult = ""
  %%SSBA1 = @SSDec2Bin(%1)
  %%SSBA2 = @SSDec2Bin(%2)
  IF @GREATER(@LEN(%%SSBA1),@LEN(%%SSBA2))
    %%SSBAStop = @LEN(%%SSBA1)
    %%SSBACheck = 1
  ELSE
    %%SSBAStop = @LEN(%%SSBA2)
    %%SSBACheck = 2
  END
  WHILE @NOT(@EQUAL(@LEN(%%SSBA2),@LEN(%%SSBA1)))
    IF @EQUAL(%%SSBACheck,1)
      %%SSBA2 = "0"%%SSBA2
    ELSE
      %%SSBA1 = "0"%%SSBA1
    END
  WEND 
  %%SSBAX = 1
  REPEAT
    IF @BOTH(@EQUAL(@SUBSTR(%%SSBA1,%%SSBAX,%%SSBAX),1),@EQUAL(@SUBSTR(%%SSBA2,%%SSBAX,%%SSBAX),1))
     %%SSBAResult = %%SSBAResult"1"
   ELSE
     %%SSBAResult = %%SSBAResult"0"     
   END
   %%SSBAX = @SUCC(%%SSBAX)
  UNTIL @GREATER(%%SSBAX,%%SSBAStop)
  %%SSBAresult = @SSBin2Dec(%%SSBAresult)
  exit %%SSBAresult

 
:SSDec2Bin
  %%SSD2Bresult = ""
  %%SSD2BintValue = %1
  While @GREATER(%%SSD2BintValue,0)
    %%SSD2Bi = @MOD(%%SSD2BIntValue,2)
    %%SSD2Bi = @FADD(%%SSD2Bi,1)
    %%SSD2BintValue = @DIV(%%SSD2BintValue,2)
    %%SSD2Bresult = @SUBSTR("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",%%SSD2Bi,%%SSD2Bi)%%SSD2Bresult
  WEND
  exit %%SSD2Bresult
 
:SSBin2Dec
  %%SSB2DResult = 0
  %%SSB2DX = 1
  %%SSB2DStrValue = %1
  REPEAT
    %%SSB2DCharValue = @POS(@UPPER(@SUBSTR(%%SSB2DStrValue,%%SSB2DX,%%SSB2DX)),"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    #return -1 if character is not supported by base
    If @GREATER(%%SSB2DCharValue,2)
     %%SSB2DResult = -1
     %%SSB2DX = @SUCC(@LEN(%%SSB2DStrValue))
   END
    %%SSB2DResult = @FADD(@FMUL(%%SSB2DResult,2),@FSUB(%%SSB2DcharValue,1))
   %%SSB2DX = @SUCC(%%SSB2DX)
  UNTIL @GREATER(%%SSB2DX,@LEN(%%SSB2DStrValue))
  exit %%SSB2DResult


For those that think that "C:\" is not a directory and it has no other attributes please use the normal VDS function @file() function. Rolling Eyes

Snarling Sheep I hope you don't mind me re-using your SSBit functions here Wink I could have do this with Gadget but I have not released the new version to the public yet.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Wed Mar 31, 2004 7:05 am    Post subject: Reply with quote

mindpower wrote:
Snarling Sheep I hope you don't mind me re-using your SSBit functions here Wink I could have do this with Gadget but I have not released the new version to the public yet.

That's what the code is there for.
I will have to charge you $379 in royalties though...I take check and charge, whichever is better for you.

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Mar 31, 2004 1:27 pm    Post subject: Reply with quote

SnarlingSheep wrote:
mindpower wrote:
Snarling Sheep I hope you don't mind me re-using your SSBit functions here Wink I could have do this with Gadget but I have not released the new version to the public yet.

That's what the code is there for.
I will have to charge you $379 in royalties though...I take check and charge, whichever is better for you.


Will you take a copy of my Gadget.dll? Wink

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Apr 01, 2004 5:55 am    Post subject: Reply with quote

Sure..I could use 2 copies for many many...um, I'm not sure what I could use 2 for. Wink
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group