deleting system files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • heiro
    New Member
    • Jul 2007
    • 56

    #1

    deleting system files

    hi,

    im new to python programming..
    im having a difficulty on how to delete a system files and read-only files..

    pls help me...

    thanks
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by heiro
    hi,

    im new to python programming..
    im having a difficulty on how to delete a system files and read-only files..

    pls help me...

    thanks
    Sounds like something that you don't want to do, but if you provide specifics you may get some guidance.

    Comment

    • heiro
      New Member
      • Jul 2007
      • 56

      #3
      Originally posted by bartonc
      Sounds like something that you don't want to do, but if you provide specifics you may get some guidance.



      It is noticeable that most of the virus in removable drives creates a "autorun.in f" w/c is a system file and a xxx.exe(virus file) w/c its attribute is also hidden/read only.when using os.remove(path) i get an error message w/c states "Permission Denied".I think it is because".inf" is a system file and read-only file.

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Originally posted by heiro
        It is noticeable that most of the virus in removable drives creates a "autorun.in f" w/c is a system file and a xxx.exe(virus file) w/c its attribute is also hidden/read only.when using os.remove(path) i get an error message w/c states "Permission Denied".I think it is because".inf" is a system file and read-only file.
        Another likely possibility is that the user account you are running as does not have the permission to delete the file.

        Comment

        • bartonc
          Recognized Expert Expert
          • Sep 2006
          • 6478

          #5
          Originally posted by heiro
          It is noticeable that most of the virus in removable drives creates a "autorun.in f" w/c is a system file and a xxx.exe(virus file) w/c its attribute is also hidden/read only.when using os.remove(path) i get an error message w/c states "Permission Denied".I think it is because".inf" is a system file and read-only file.
          Files that are opened (currently being used) by another application will give this error. .inf files are really just text files.

          Comment

          • heiro
            New Member
            • Jul 2007
            • 56

            #6
            Originally posted by bartonc
            Files that are opened (currently being used) by another application will give this error. .inf files are really just text files.
            ahh ok i got it..but how about read-only files is there any ways how to change it's attributes?..th anks for the prompt reply

            Comment

            • heiro
              New Member
              • Jul 2007
              • 56

              #7
              Originally posted by Motoma
              Another likely possibility is that the user account you are running as does not have the permission to delete the file.

              im using the administrator account but it still it prompt me the error...

              Comment

              • bartonc
                Recognized Expert Expert
                • Sep 2006
                • 6478

                #8
                Originally posted by heiro
                ahh ok i got it..but how about read-only files is there any ways how to change it's attributes?..th anks for the prompt reply
                From the os module docs:
                Originally posted by 6.1.4 Files and Directories
                chmod( path, mode)

                Change the mode of path to the numeric mode. mode may take one of the following values (as defined in the stat module) or bitwise or-ed combinations of them:
                S_ISUID
                S_ISGID
                S_ENFMT
                S_ISVTX
                S_IREAD
                S_IWRITE
                S_IEXEC
                S_IRWXU
                S_IRUSR
                S_IWUSR
                S_IXUSR
                S_IRWXG
                S_IRGRP
                S_IWGRP
                S_IXGRP
                S_IRWXO
                S_IROTH
                S_IWOTH
                S_IXOTH
                Availability: Macintosh, Unix, Windows.

                Comment

                • heiro
                  New Member
                  • Jul 2007
                  • 56

                  #9
                  Originally posted by bartonc
                  From the os module docs:

                  thanks a lot....i will try using it.....i'll just post again if i will encounter problems

                  Comment

                  Working...