Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Accessing the Startup Folder
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prince Pwn




PostPosted: Tue Sep 30, 2008 6:27 am   Post subject: Accessing the Startup Folder

Can Turing access the startup folder in Windows XP? I'm getting an error, maybe there's something wrong with my code but it shows up as read only:

Turing:

type data :
    record
        size, attribute, fileTime, stream : int
        pathName : string
    end record

var file : data
file.pathName := "C:/Documents and Settings/" + Sys.GetUserName + "/Start Menu/Programs/Startup"

File.Status (file.pathName, file.size, file.attribute, file.fileTime)
if Error.Last = eNoError then
    put "      Name: ", File.FullPath (file.pathName)
    put "   Created: ", Time.SecDate (file.fileTime)
    put "      Size: ", file.size, " bytes"
    put "Attributes: " ..
    if (file.attribute and ootAttrDir) not= 0 then
        put "Directory " ..
    else
        put "" ..
    end if
    if (file.attribute and ootAttrRead) not= 0 then
        put "Readable " ..
    else
        put "" ..
    end if
    if (file.attribute and ootAttrWrite) not= 0 then
        put "Writable " ..
    else
        put "" ..
    end if
    if (file.attribute and ootAttrExecute) not= 0 then
        put "Executable", skip
    else
        put skip
    end if
else
    put "Unable to get file information"
    put "Error: ", Error.LastMsg, skip
end if


open : file.stream, file.pathName, put, mod
%put :
close : file.stream
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Tue Sep 30, 2008 9:11 am   Post subject: RE:Accessing the Startup Folder

Maybe because it is read-only? What kind of account the user is on could greatly limit the amount of poking around you are able to do.
S_Grimm




PostPosted: Tue Sep 30, 2008 10:15 am   Post subject: RE:Accessing the Startup Folder

unless your going through DOS or LINUX, windows directory is read only. ie YOU CAN NOT CHANGE IT!
Insectoid




PostPosted: Tue Sep 30, 2008 1:18 pm   Post subject: RE:Accessing the Startup Folder

go to the file and select 'properties' and uncheck 'read-only'. This works for most files, dunno about the directory.
Prince Pwn




PostPosted: Tue Sep 30, 2008 3:00 pm   Post subject: RE:Accessing the Startup Folder

Thanks for the suggestions, but it was a mistake in the coding. I forgot to add the filename to the path,

Turing:

file.path + '/' + file.name
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: